move options to dedicated package
Some checks failed
lint / lint (pull_request) Failing after 1m31s
pr / test (pull_request) Failing after 2m37s

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2023-07-29 00:40:58 +03:00
parent b1dbd99ce2
commit 6f6f850af6
84 changed files with 1154 additions and 4521 deletions

View File

@@ -4,6 +4,8 @@ package store // import "go.unistack.org/micro/v4/store"
import (
"context"
"errors"
"go.unistack.org/micro/v4/options"
)
var (
@@ -21,21 +23,21 @@ var (
type Store interface {
Name() string
// Init initialises the store
Init(opts ...Option) error
Init(opts ...options.Option) error
// Connect is used when store needs to be connected
Connect(ctx context.Context) error
// Options allows you to view the current options.
Options() Options
// Exists check that key exists in store
Exists(ctx context.Context, key string, opts ...ExistsOption) error
// Read reads a single key name to provided value with optional ReadOptions
Read(ctx context.Context, key string, val interface{}, opts ...ReadOption) error
// Write writes a value to key name to the store with optional WriteOption
Write(ctx context.Context, key string, val interface{}, opts ...WriteOption) error
// Delete removes the record with the corresponding key from the store.
Delete(ctx context.Context, key string, opts ...DeleteOption) error
// List returns any keys that match, or an empty list with no error if none matched.
List(ctx context.Context, opts ...ListOption) ([]string, error)
Exists(ctx context.Context, key string, opts ...options.Option) error
// Read reads a single key name to provided value with optional options
Read(ctx context.Context, key string, val interface{}, opts ...options.Option) error
// Write writes a value to key name to the store with optional options
Write(ctx context.Context, key string, val interface{}, opts ...options.Option) error
// Delete removes the record with the corresponding key from the store with optional options
Delete(ctx context.Context, key string, opts ...options.Option) error
// List returns any keys that match, or an empty list with no error if none matched with optional options
List(ctx context.Context, opts ...options.Option) ([]string, error)
// Disconnect the store
Disconnect(ctx context.Context) error
// String returns the name of the implementation.