support ability to set store, address and namespace via flags and env vars (#1092)
This commit is contained in:
@@ -25,10 +25,6 @@ func getAccount(ctx context.Context) string {
|
||||
return getOption(ctx, "CF_ACCOUNT_ID")
|
||||
}
|
||||
|
||||
func getNamespace(ctx context.Context) string {
|
||||
return getOption(ctx, "KV_NAMESPACE_ID")
|
||||
}
|
||||
|
||||
// Token sets the cloudflare api token
|
||||
func Token(t string) store.Option {
|
||||
return func(o *store.Options) {
|
||||
@@ -52,9 +48,6 @@ func Account(id string) store.Option {
|
||||
// Namespace sets the KV namespace
|
||||
func Namespace(ns string) store.Option {
|
||||
return func(o *store.Options) {
|
||||
if o.Context == nil {
|
||||
o.Context = context.Background()
|
||||
}
|
||||
o.Context = context.WithValue(o.Context, "KV_NAMESPACE_ID", ns)
|
||||
o.Namespace = ns
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user