Documentation ¶
Index ¶
Constants ¶
const (
// EnvVarName defines where to pass the profile name between disconnected functions
EnvVarName = "VOYAGER_PROFILE"
)
Variables ¶
This section is empty.
Functions ¶
func SetProfile ¶ added in v0.9.0
SetProfile exports variables from a lookup
Types ¶
type KeyringStore ¶ added in v0.9.0
type KeyringStore struct {
Name string
}
KeyringStore fetches credentials from the system keyring
func (*KeyringStore) Check ¶ added in v0.9.0
func (k *KeyringStore) Check(profile string) bool
Check returns if the credentials are cached in the keyring
func (*KeyringStore) Delete ¶ added in v0.10.4
func (k *KeyringStore) Delete(profile string) error
Delete removes a profile from the keyring
func (*KeyringStore) Lookup ¶ added in v0.9.0
func (k *KeyringStore) Lookup(profile string) (credentials.Value, error)
Lookup checks the keyring for credentials
func (*KeyringStore) Write ¶ added in v0.9.0
func (k *KeyringStore) Write(profile string, creds credentials.Value) error
Write caches the credentials for the user
type MultiStore ¶ added in v0.9.0
type MultiStore struct {
Backends []Store
}
MultiStore is a storage backend which tries a series of backends
func (*MultiStore) Check ¶ added in v0.9.0
func (m *MultiStore) Check(profile string) bool
Check returns true if any backend has the credentials cached
func (*MultiStore) Delete ¶ added in v0.10.4
func (m *MultiStore) Delete(profile string) error
Delete removes a profile from all backends
func (*MultiStore) Lookup ¶ added in v0.9.0
func (m *MultiStore) Lookup(profile string) (credentials.Value, error)
Lookup looks up creds from the list of backends
type PromptStore ¶ added in v0.9.0
type PromptStore struct{}
PromptStore is a storage backend which asks the user for input
func (*PromptStore) Check ¶ added in v0.9.0
func (p *PromptStore) Check(_ string) bool
Check is always false, because user input is never cached
func (*PromptStore) Delete ¶ added in v0.10.4
func (p *PromptStore) Delete(_ string) error
Delete is a no-op, as Prompt never stores credentials
func (*PromptStore) Lookup ¶ added in v0.9.0
func (p *PromptStore) Lookup(profile string) (credentials.Value, error)
Lookup asks the user for credentials
type Store ¶
type Store interface { Lookup(string) (credentials.Value, error) Check(string) bool Delete(string) error }
Store is an object which can look up credentials
func NewDefaultStore ¶ added in v0.9.0
func NewDefaultStore() Store
NewDefaultStore returns the default backend set
type WritableStore ¶ added in v0.9.0
type WritableStore interface {
Write(string, credentials.Value) error
}
WritableStore defines a backend which can save credentials