move memory implementations to core micro repo
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
@@ -1,69 +0,0 @@
|
||||
package store
|
||||
|
||||
import "context"
|
||||
|
||||
type noopStore struct {
|
||||
opts Options
|
||||
}
|
||||
|
||||
func NewStore(opts ...Option) Store {
|
||||
return &noopStore{opts: NewOptions(opts...)}
|
||||
}
|
||||
|
||||
// Init initialize store
|
||||
func (n *noopStore) Init(opts ...Option) error {
|
||||
for _, o := range opts {
|
||||
o(&n.opts)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Options returns Options struct
|
||||
func (n *noopStore) Options() Options {
|
||||
return n.opts
|
||||
}
|
||||
|
||||
// Name
|
||||
func (n *noopStore) Name() string {
|
||||
return n.opts.Name
|
||||
}
|
||||
|
||||
// String returns string representation
|
||||
func (n *noopStore) String() string {
|
||||
return "noop"
|
||||
}
|
||||
|
||||
// Read reads store value by key
|
||||
func (n *noopStore) Exists(ctx context.Context, key string, opts ...ExistsOption) 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, key string, val interface{}, opts ...WriteOption) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Delete removes store value by key
|
||||
func (n *noopStore) Delete(ctx context.Context, key string, opts ...DeleteOption) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// List lists store
|
||||
func (n *noopStore) List(ctx context.Context, opts ...ListOption) ([]string, error) {
|
||||
return []string{}, nil
|
||||
}
|
||||
|
||||
// Connect connects to store
|
||||
func (n *noopStore) Connect(ctx context.Context) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Disconnect disconnects from store
|
||||
func (n *noopStore) Disconnect(ctx context.Context) error {
|
||||
return nil
|
||||
}
|
||||
Reference in New Issue
Block a user