Rename store Namespace / Prefix options to Database and Table (#1492)
* Rename Namespace to DB, Rename Prefix to table, Remove Suffix Option * Rename options * Rename options * Add store_table option * Table per service, not Database per service
This commit is contained in:
@@ -105,8 +105,8 @@ func (w *workersKV) Init(opts ...store.Option) error {
|
||||
for _, o := range opts {
|
||||
o(&w.options)
|
||||
}
|
||||
if len(w.options.Namespace) > 0 {
|
||||
w.namespace = w.options.Namespace
|
||||
if len(w.options.Database) > 0 {
|
||||
w.namespace = w.options.Database
|
||||
}
|
||||
ttl := w.options.Context.Value("STORE_CACHE_TTL")
|
||||
if ttl != nil {
|
||||
@@ -388,7 +388,7 @@ func NewStore(opts ...store.Option) store.Store {
|
||||
}
|
||||
|
||||
if len(namespace) == 0 {
|
||||
namespace = options.Namespace
|
||||
namespace = options.Database
|
||||
}
|
||||
|
||||
// validate options are not blank or log.Fatal
|
||||
|
@@ -49,7 +49,7 @@ func Account(id string) store.Option {
|
||||
// Namespace sets the KV namespace
|
||||
func Namespace(ns string) store.Option {
|
||||
return func(o *store.Options) {
|
||||
o.Namespace = ns
|
||||
o.Database = ns
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user