store: refactor interface (#11)

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2020-12-10 22:08:56 +03:00
committed by GitHub
parent a754ff7c0c
commit 6a7433ba2a
8 changed files with 73 additions and 62 deletions

View File

@@ -29,12 +29,17 @@ func (n *noopStore) String() string {
}
// Read reads store value by key
func (n *noopStore) Read(ctx context.Context, key string, opts ...ReadOption) ([]*Record, error) {
return []*Record{}, nil
func (n *noopStore) Exists(ctx context.Context, key string) error {
return ErrNotFound
}
// Read reads store value by key
func (n *noopStore) Read(ctx context.Context, key string, val interface{}, opts ...ReadOption) error {
return ErrNotFound
}
// Write writes store record
func (n *noopStore) Write(ctx context.Context, r *Record, opts ...WriteOption) error {
func (n *noopStore) Write(ctx context.Context, key string, val interface{}, opts ...WriteOption) error {
return nil
}