initial import

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2020-12-10 01:42:28 +03:00
commit 8c4f27bda5
9 changed files with 984 additions and 0 deletions

42
options.go Normal file
View File

@@ -0,0 +1,42 @@
package vault
import (
"github.com/hashicorp/vault/api"
"github.com/unistack-org/micro/v3/config"
)
type configKey struct{}
func Config(cfg *api.Config) config.Option {
return config.SetOption(configKey{}, cfg)
}
type tokenKey struct{}
func Token(token string) config.Option {
return config.SetOption(tokenKey{}, token)
}
type addrKey struct{}
func Address(addr string) config.Option {
return config.SetOption(addrKey{}, addr)
}
type pathKey struct{}
func Path(path string) config.Option {
return config.SetOption(pathKey{}, path)
}
type roleIDKey struct{}
func RoleID(role string) config.Option {
return config.SetOption(roleIDKey{}, role)
}
type secretIDKey struct{}
func SecretID(secret string) config.Option {
return config.SetOption(secretIDKey{}, secret)
}