Documentation
¶
Overview ¶
Package keyring stores Melange credentials in the OS keychain via zalando/go-keyring. Entries live under the "melange-cli" service, keyed by host (scheme stripped, port kept — see HostKey).
Index ¶
- Variables
- func Delete(host string) error
- func DeleteOAuth(host string) error
- func Get(host string) (string, error)
- func GetOAuth(host string) (*config.OAuthCredentials, error)
- func HostKey(host string) string
- func Lookup(host string) (string, bool, error)
- func LookupOAuth(host string) (*config.OAuthCredentials, bool, error)
- func Set(host, token string) error
- func SetOAuth(host string, creds config.OAuthCredentials) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotFound = errors.New("no credentials found in keyring")
ErrNotFound is returned when no credential is stored for a host.
Functions ¶
func DeleteOAuth ¶ added in v0.5.0
DeleteOAuth removes OAuth credentials for host.
func GetOAuth ¶ added in v0.5.0
func GetOAuth(host string) (*config.OAuthCredentials, error)
GetOAuth returns OAuth credentials for host or ErrNotFound.
func HostKey ¶
HostKey normalizes a host or URL into the keyring key: scheme and path are stripped, the port is kept ("https://api.zetic.ai:8443/v1" -> "api.zetic.ai:8443").
func LookupOAuth ¶ added in v0.5.0
func LookupOAuth(host string) (*config.OAuthCredentials, bool, error)
LookupOAuth adapts GetOAuth to the ResolveOAuth lookup signature.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.