diff --git a/store/noop.go b/store/noop.go index eb6db0d4..6f3b2d5d 100644 --- a/store/noop.go +++ b/store/noop.go @@ -14,7 +14,7 @@ func newStore(opts ...Option) Store { return &noopStore{opts: options} } -func (n *noopStore) Init(opts ...Option) error { +func (n *noopStore) Init(ctx context.Context, opts ...Option) error { for _, o := range opts { o(&n.opts) } @@ -45,6 +45,6 @@ func (n *noopStore) List(ctx context.Context, opts ...ListOption) ([]string, err return []string{}, nil } -func (n *noopStore) Close() error { +func (n *noopStore) Close(ctx context.Context) error { return nil } diff --git a/store/store.go b/store/store.go index 336e9278..131d2a0a 100644 --- a/store/store.go +++ b/store/store.go @@ -17,7 +17,7 @@ var ( // Store is a data storage interface type Store interface { // Init initialises the store. It must perform any required setup on the backing storage implementation and check that it is ready for use, returning any errors. - Init(...Option) error + Init(ctx context.Context, opts ...Option) error // Options allows you to view the current options. Options() Options // Read takes a single key name and optional ReadOptions. It returns matching []*Record or an error. @@ -29,7 +29,7 @@ type Store interface { // List returns any keys that match, or an empty list with no error if none matched. List(ctx context.Context, opts ...ListOption) ([]string, error) // Close the store - Close() error + Close(ctx context.Context) error // String returns the name of the implementation. String() string }