2020-03-12 16:41:30 +03:00
|
|
|
package store
|
|
|
|
|
2020-09-03 15:11:05 +03:00
|
|
|
type noopStore struct {
|
|
|
|
opts Options
|
|
|
|
}
|
|
|
|
|
|
|
|
func newStore(opts ...Option) Store {
|
|
|
|
options := NewOptions()
|
|
|
|
for _, o := range opts {
|
|
|
|
o(&options)
|
|
|
|
}
|
|
|
|
return &noopStore{opts: options}
|
|
|
|
}
|
2020-03-12 16:41:30 +03:00
|
|
|
|
|
|
|
func (n *noopStore) Init(opts ...Option) error {
|
2020-09-03 15:11:05 +03:00
|
|
|
for _, o := range opts {
|
|
|
|
o(&n.opts)
|
|
|
|
}
|
2020-03-12 16:41:30 +03:00
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (n *noopStore) Options() Options {
|
2020-09-03 15:11:05 +03:00
|
|
|
return n.opts
|
2020-03-12 16:41:30 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
func (n *noopStore) String() string {
|
|
|
|
return "noop"
|
|
|
|
}
|
|
|
|
|
|
|
|
func (n *noopStore) Read(key string, opts ...ReadOption) ([]*Record, error) {
|
|
|
|
return []*Record{}, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (n *noopStore) Write(r *Record, opts ...WriteOption) error {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (n *noopStore) Delete(key string, opts ...DeleteOption) error {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (n *noopStore) List(opts ...ListOption) ([]string, error) {
|
|
|
|
return []string{}, nil
|
|
|
|
}
|
2020-04-08 11:51:10 +03:00
|
|
|
|
|
|
|
func (n *noopStore) Close() error {
|
|
|
|
return nil
|
|
|
|
}
|