mirror of
https://github.com/pomerium/pomerium.git
synced 2025-08-02 16:30:17 +02:00
pkg/storage: change backend interface to return error (#1131)
Since when storage backend like redis can be fault in many cases, the interface should return error for the caller to handle.
This commit is contained in:
parent
90d95b8c10
commit
aedfbc4c71
7 changed files with 108 additions and 69 deletions
|
@ -16,13 +16,13 @@ type Backend interface {
|
|||
Put(ctx context.Context, id string, data *anypb.Any) error
|
||||
|
||||
// Get is used to retrieve a record.
|
||||
Get(ctx context.Context, id string) *databroker.Record
|
||||
Get(ctx context.Context, id string) (*databroker.Record, error)
|
||||
|
||||
// GetAll is used to retrieve all the records.
|
||||
GetAll(ctx context.Context) []*databroker.Record
|
||||
GetAll(ctx context.Context) ([]*databroker.Record, error)
|
||||
|
||||
// List is used to retrieve all the records since a version.
|
||||
List(ctx context.Context, sinceVersion string) []*databroker.Record
|
||||
List(ctx context.Context, sinceVersion string) ([]*databroker.Record, error)
|
||||
|
||||
// Delete is used to mark a record as deleted.
|
||||
Delete(ctx context.Context, id string) error
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue