databroker: add support for field masks on Put (#3210)

* databroker: add support for field masks on Put

* return errors

* clean up go.mod
This commit is contained in:
Caleb Doxsey 2022-03-29 16:36:40 -06:00 committed by GitHub
parent 8fc5dbf4c5
commit 2dc778035d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 381 additions and 134 deletions

View file

@ -11,6 +11,7 @@ import (
"google.golang.org/grpc/status"
"google.golang.org/protobuf/reflect/protoreflect"
"google.golang.org/protobuf/types/known/anypb"
"google.golang.org/protobuf/types/known/fieldmaskpb"
"github.com/pomerium/pomerium/internal/log"
"github.com/pomerium/pomerium/pkg/grpc/databroker"
@ -51,7 +52,7 @@ type Backend interface {
// Lease acquires a lease, or renews an existing one. If the lease is acquired true is returned.
Lease(ctx context.Context, leaseName, leaseID string, ttl time.Duration) (bool, error)
// Put is used to insert or update a record.
Put(ctx context.Context, record *databroker.Record) (serverVersion uint64, err error)
Put(ctx context.Context, record *databroker.Record, mask *fieldmaskpb.FieldMask) (serverVersion uint64, err error)
// SetOptions sets the options for a type.
SetOptions(ctx context.Context, recordType string, options *databroker.Options) error
// Sync syncs record changes after the specified version.