change options to be trimmed down

This commit is contained in:
Asim Aslam 2019-10-23 23:12:45 +01:00
parent 232c8ac7a1
commit 4db1e09798
3 changed files with 9 additions and 9 deletions

View File

@ -56,8 +56,8 @@ func TestStorageImplementation(t *testing.T) {
var s certmagic.Storage var s certmagic.Storage
st := cfstore.NewStore( st := cfstore.NewStore(
cfstore.ApiToken(apiToken), cfstore.Token(apiToken),
cfstore.AccountID(accountID), cfstore.Account(accountID),
cfstore.Namespace(kvID), cfstore.Namespace(kvID),
) )
s = &storage{ s = &storage{
@ -193,8 +193,8 @@ func TestE2e(t *testing.T) {
testLock := memory.NewLock() testLock := memory.NewLock()
testStore := cfstore.NewStore( testStore := cfstore.NewStore(
cfstore.ApiToken(apiToken), cfstore.Token(apiToken),
cfstore.AccountID(accountID), cfstore.Account(accountID),
cfstore.Namespace(kvID), cfstore.Namespace(kvID),
) )
testStorage := NewStorage(testLock, testStore) testStorage := NewStorage(testLock, testStore)

View File

@ -21,8 +21,8 @@ func TestCloudflare(t *testing.T) {
randomV := strconv.Itoa(rand.Int()) randomV := strconv.Itoa(rand.Int())
wkv := NewStore( wkv := NewStore(
ApiToken(apiToken), Token(apiToken),
AccountID(accountID), Account(accountID),
Namespace(kvID), Namespace(kvID),
) )

View File

@ -5,13 +5,13 @@ import (
) )
// Token sets the cloudflare api token // Token sets the cloudflare api token
func ApiToken(t string) options.Option { func Token(t string) options.Option {
// TODO: change to store.cf.api_token // TODO: change to store.cf.api_token
return options.WithValue("CF_API_TOKEN", t) return options.WithValue("CF_API_TOKEN", t)
} }
// AccountID sets the cloudflare account id // Account sets the cloudflare account id
func AccountID(id string) options.Option { func Account(id string) options.Option {
// TODO: change to store.cf.account_id // TODO: change to store.cf.account_id
return options.WithValue("CF_ACCOUNT_ID", id) return options.WithValue("CF_ACCOUNT_ID", id)
} }