databroker: add options for maximum capacity (#2095)

* databroker: add options

* implement redis

* add trace for enforce options
This commit is contained in:
Caleb Doxsey 2021-04-26 17:14:54 -06:00 committed by GitHub
parent b3216ae854
commit 636b3d6846
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 1085 additions and 419 deletions

View file

@ -93,6 +93,10 @@ func (e *encryptedBackend) GetAll(ctx context.Context) ([]*databroker.Record, ui
return records, version, nil
}
func (e *encryptedBackend) GetOptions(ctx context.Context, recordType string) (*databroker.Options, error) {
return e.underlying.GetOptions(ctx, recordType)
}
func (e *encryptedBackend) Put(ctx context.Context, record *databroker.Record) error {
encrypted, err := e.encrypt(record.GetData())
if err != nil {
@ -112,6 +116,10 @@ func (e *encryptedBackend) Put(ctx context.Context, record *databroker.Record) e
return nil
}
func (e *encryptedBackend) SetOptions(ctx context.Context, recordType string, options *databroker.Options) error {
return e.underlying.SetOptions(ctx, recordType, options)
}
func (e *encryptedBackend) Sync(ctx context.Context, version uint64) (RecordStream, error) {
stream, err := e.underlying.Sync(ctx, version)
if err != nil {