micro/store/options.go

22 lines
530 B
Go
Raw Normal View History

2019-06-12 09:46:20 +03:00
package store
2019-06-11 19:20:52 +03:00
import (
2019-06-12 14:45:42 +03:00
"github.com/micro/go-micro/config/options"
2019-06-11 19:20:52 +03:00
)
2019-11-01 17:13:21 +03:00
// Nodes is a list of nodes used to back the store
2019-06-11 19:20:52 +03:00
func Nodes(a ...string) options.Option {
2019-06-12 09:46:20 +03:00
return options.WithValue("store.nodes", a)
2019-06-11 19:20:52 +03:00
}
// Prefix sets a prefix to any key ids used
func Prefix(p string) options.Option {
2019-06-12 09:46:20 +03:00
return options.WithValue("store.prefix", p)
2019-06-11 19:20:52 +03:00
}
2019-11-01 17:13:21 +03:00
// Namespace offers a way to have multiple isolated
// stores in the same backend, if supported.
func Namespace(n string) options.Option {
return options.WithValue("store.namespace", n)
}