micro: rewrite options to support multiple building blocks

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2021-01-29 13:17:32 +03:00
parent ac8a3a12c4
commit 827d467077
57 changed files with 1283 additions and 644 deletions

View File

@@ -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"

View File

@@ -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.

View File

@@ -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