micro: rewrite options to support multiple building blocks
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
@@ -23,6 +23,11 @@ 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"
|
||||
|
||||
@@ -14,6 +14,7 @@ import (
|
||||
|
||||
// Options contains configuration for the Store
|
||||
type Options struct {
|
||||
Name string
|
||||
// Nodes contains the addresses or other connection information of the backing storage.
|
||||
// For example, an etcd implementation would contain the nodes of the cluster.
|
||||
// A SQL implementation could contain one or more connection strings.
|
||||
|
||||
@@ -20,6 +20,7 @@ var (
|
||||
|
||||
// Store is a data storage interface
|
||||
type Store interface {
|
||||
Name() string
|
||||
// Init initialises the store
|
||||
Init(opts ...Option) error
|
||||
// Connect is used when store needs to be connected
|
||||
|
||||
Reference in New Issue
Block a user