mirror of
https://github.com/pomerium/pomerium.git
synced 2025-08-03 08:50:42 +02:00
databroker: add patch method (#4704)
Add a Patch() method to the databroker gRPC service. Update the storage.Backend interface to include the Patch() method now that all the storage.Backend implementations include it. Add a test to exercise the patch method under concurrent usage.
This commit is contained in:
parent
4842002ed7
commit
d5da872157
9 changed files with 760 additions and 337 deletions
|
@ -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"
|
||||
|
@ -37,6 +38,8 @@ type Backend interface {
|
|||
ListTypes(ctx context.Context) ([]string, error)
|
||||
// Put is used to insert or update records.
|
||||
Put(ctx context.Context, records []*databroker.Record) (serverVersion uint64, err error)
|
||||
// Patch is used to update specific fields of existing records.
|
||||
Patch(ctx context.Context, records []*databroker.Record, fields *fieldmaskpb.FieldMask) (serverVersion uint64, patchedRecords []*databroker.Record, 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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue