mirror of
https://github.com/pomerium/pomerium.git
synced 2025-05-17 19:17:17 +02:00
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:
parent
8fc5dbf4c5
commit
2dc778035d
15 changed files with 381 additions and 134 deletions
|
@ -5,6 +5,7 @@ import (
|
|||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"google.golang.org/protobuf/types/known/fieldmaskpb"
|
||||
|
||||
"github.com/pomerium/pomerium/pkg/grpc/databroker"
|
||||
"github.com/pomerium/pomerium/pkg/grpc/user"
|
||||
|
@ -13,7 +14,7 @@ import (
|
|||
|
||||
type mockBackend struct {
|
||||
Backend
|
||||
put func(ctx context.Context, record *databroker.Record) (uint64, error)
|
||||
put func(ctx context.Context, record *databroker.Record, mask *fieldmaskpb.FieldMask) (uint64, error)
|
||||
get func(ctx context.Context, recordType, id string) (*databroker.Record, error)
|
||||
getAll func(ctx context.Context) ([]*databroker.Record, *databroker.Versions, error)
|
||||
}
|
||||
|
@ -22,8 +23,8 @@ func (m *mockBackend) Close() error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func (m *mockBackend) Put(ctx context.Context, record *databroker.Record) (uint64, error) {
|
||||
return m.put(ctx, record)
|
||||
func (m *mockBackend) Put(ctx context.Context, record *databroker.Record, mask *fieldmaskpb.FieldMask) (uint64, error) {
|
||||
return m.put(ctx, record, mask)
|
||||
}
|
||||
|
||||
func (m *mockBackend) Get(ctx context.Context, recordType, id string) (*databroker.Record, error) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue