Documentation
¶
Index ¶
Constants ¶
View Source
const KeyringServiceName string = "UpCloud"
KeyringServiceName is the name of the service to use when using the system keyring
View Source
const KeyringTokenUser string = ""
KeyringTokenUser is the username to use for the token in the system keyring
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Credentials ¶
type Credentials struct {
Username string
Password string
Token string
// contains filtered or unexported fields
}
func Parse ¶
func Parse(config Credentials) (Credentials, error)
Parse reads credentials from environment variables or the system keyring and allows overriding these with parameters. If both basic auth and token are provided, basic auth credentials will be omitted from the return value. Any credentials defined in the parameters will take precedence over those read from the environment and any credentials defined in the environment will take precedence over those read from the keyring.
func (Credentials) IsDefined ¶
func (c Credentials) IsDefined() bool
func (Credentials) Source ¶
func (c Credentials) Source() CredentialsSource
func (Credentials) Type ¶
func (c Credentials) Type() CredentialsType
type CredentialsSource ¶
type CredentialsSource string
const ( CredentialsSourceConfiguration CredentialsSource = "configuration" CredentialsSourceEnvironment CredentialsSource = "environment" CredentialsSourceKeyring CredentialsSource = "keyring" )
type CredentialsType ¶
type CredentialsType string
const ( CredentialsTypeBasic CredentialsType = "basic" CredentialsTypeToken CredentialsType = "token" )
Click to show internal directories.
Click to hide internal directories.