mirror of
https://github.com/pomerium/pomerium.git
synced 2025-05-21 04:57:18 +02:00
zero/telemetry: calculate DAU and MAU (#4810)
This commit is contained in:
parent
e0ac870442
commit
c4dd965f2d
9 changed files with 485 additions and 0 deletions
|
@ -8,6 +8,8 @@ import (
|
|||
"fmt"
|
||||
"io"
|
||||
|
||||
"google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
"google.golang.org/protobuf/encoding/protojson"
|
||||
"google.golang.org/protobuf/proto"
|
||||
structpb "google.golang.org/protobuf/types/known/structpb"
|
||||
|
@ -33,6 +35,11 @@ func NewRecord(object recordObject) *Record {
|
|||
}
|
||||
}
|
||||
|
||||
// IsNotFound returns true if the error is a not found error.
|
||||
func IsNotFound(err error) bool {
|
||||
return status.Code(err) == codes.NotFound
|
||||
}
|
||||
|
||||
// Get gets a record from the databroker and unmarshals it into the object.
|
||||
func Get(ctx context.Context, client DataBrokerServiceClient, object recordObject) error {
|
||||
res, err := client.Get(ctx, &GetRequest{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue