mirror of
https://github.com/pomerium/pomerium.git
synced 2025-05-29 08:57:18 +02:00
databroker: store server version in backend (#2142)
This commit is contained in:
parent
1b698053f6
commit
91c7dc742f
15 changed files with 317 additions and 333 deletions
|
@ -13,16 +13,16 @@ import (
|
|||
|
||||
type mockBackend struct {
|
||||
Backend
|
||||
put func(ctx context.Context, record *databroker.Record) error
|
||||
put func(ctx context.Context, record *databroker.Record) (uint64, error)
|
||||
get func(ctx context.Context, recordType, id string) (*databroker.Record, error)
|
||||
getAll func(ctx context.Context) ([]*databroker.Record, uint64, error)
|
||||
getAll func(ctx context.Context) ([]*databroker.Record, *databroker.Versions, error)
|
||||
}
|
||||
|
||||
func (m *mockBackend) Close() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *mockBackend) Put(ctx context.Context, record *databroker.Record) error {
|
||||
func (m *mockBackend) Put(ctx context.Context, record *databroker.Record) (uint64, error) {
|
||||
return m.put(ctx, record)
|
||||
}
|
||||
|
||||
|
@ -30,14 +30,10 @@ func (m *mockBackend) Get(ctx context.Context, recordType, id string) (*databrok
|
|||
return m.get(ctx, recordType, id)
|
||||
}
|
||||
|
||||
func (m *mockBackend) GetAll(ctx context.Context) ([]*databroker.Record, uint64, error) {
|
||||
func (m *mockBackend) GetAll(ctx context.Context) ([]*databroker.Record, *databroker.Versions, error) {
|
||||
return m.getAll(ctx)
|
||||
}
|
||||
|
||||
func (m *mockBackend) Sync(ctx context.Context, version uint64) (RecordStream, error) {
|
||||
panic("implement me")
|
||||
}
|
||||
|
||||
func TestMatchAny(t *testing.T) {
|
||||
u := &user.User{Id: "id", Name: "name", Email: "email"}
|
||||
data, _ := anypb.New(u)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue