Documentation
¶
Index ¶
- Variables
- func PutToken(t Token, ss SecretStore) error
- func RemoveToken(name string, ss SecretStore) error
- func SetCurrentToken(name string, cs ConfigStore, ss SecretStore) error
- func TokenExists(name string, ss SecretStore) (bool, error)
- type Config
- type ConfigStore
- type JSONConfigStore
- type KeychainSecretStore
- type SecretStore
- type Secrets
- type Token
Constants ¶
This section is empty.
Variables ¶
var ErrConfigNotFound = errors.New("config did not exist")
ErrConfigNotFound is returned if there is no Config in a ConfigStore.
var ErrTokenNotFound = errors.New("token does not exist")
ErrTokenNotFound is returned if there is no Token in a ConfigStore.
Functions ¶
func PutToken ¶ added in v0.1.0
func PutToken(t Token, ss SecretStore) error
func RemoveToken ¶ added in v0.1.0
func RemoveToken(name string, ss SecretStore) error
func SetCurrentToken ¶
func SetCurrentToken(name string, cs ConfigStore, ss SecretStore) error
SetCurrentToken is a convenient way to set the CurrentToken field in a the current config.
func TokenExists ¶ added in v0.21.4
func TokenExists(name string, ss SecretStore) (bool, error)
Types ¶
type ConfigStore ¶
ConfigStore is anything that can persistently store a Config.
type JSONConfigStore ¶ added in v0.1.0
type JSONConfigStore struct {
ConfigPath string
}
JSONConfigStore implements a ConfigStore that stores its Config in a JSON file at the provided ConfigPath.
func (JSONConfigStore) Exists ¶ added in v0.21.4
func (s JSONConfigStore) Exists() (bool, error)
func (JSONConfigStore) Get ¶ added in v0.1.0
func (s JSONConfigStore) Get() (Config, error)
Get parses a Config from the filesystem.
func (JSONConfigStore) Put ¶ added in v0.1.0
func (s JSONConfigStore) Put(cfg Config) error
Put overwrites a Config on the filesystem.
type KeychainSecretStore ¶ added in v0.1.0
type KeychainSecretStore struct {
ConfigPath string
// contains filtered or unexported fields
}
func (*KeychainSecretStore) Get ¶ added in v0.1.0
func (k *KeychainSecretStore) Get() (Secrets, error)
func (*KeychainSecretStore) Put ¶ added in v0.1.0
func (k *KeychainSecretStore) Put(s Secrets) error
type SecretStore ¶ added in v0.1.0
type Token ¶
type Token struct {
Name string
Endpoint string
APIToken string
Insecure *bool
NoVerifyCA *bool
CACert []byte
}
func CurrentToken ¶
func CurrentToken(cs ConfigStore, ss SecretStore) (token Token, err error)
CurrentToken is a convenient way to obtain the CurrentToken field from the current Config.
func GetTokenIfExists ¶ added in v0.21.4
func GetTokenIfExists(name string, ss SecretStore) (Token, error)
Returns an empty token if no token exists.
func TokenWithOverride ¶ added in v0.21.2
TokenWithOverride returns a Token that retrieves its values from the reference Token, and has its values overridden any of the non-empty/non-nil values of the overrideToken.