Documentation ¶
Overview ¶
Package keyring implements functions for accessing and storing passwords in the system's keyring (Keychain on macOS, Credential Manager on Windows, Secret Service on Linux).
Index ¶
Constants ¶
View Source
const ErrKeyring = "ErrKeyring"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type FileKeyring ¶
FileKeyring is a keyring that stores passwords in a file.
func (*FileKeyring) Delete ¶
func (self *FileKeyring) Delete(service, user string) error
func (*FileKeyring) Set ¶
func (self *FileKeyring) Set(service, user, pass string) error
type Keyring ¶
type Keyring interface { // Get gets the password for a service and user. Get(service, user string) (string, error) // Set sets the password for a service and user. Set(service, user, pass string) error // Delete deletes the password for a service and user. Delete(service, user string) error }
Keyring is the interface that a system-specific or custom keyring must implement.
var DefaultKeyring Keyring
The default keyring.
type OverlayKeyring ¶
type OverlayKeyring struct { Keyrings []Keyring // contains filtered or unexported fields }
OverlayKeyring is a keyring that stores passwords in a hierarchy of keyrings.
func (*OverlayKeyring) Delete ¶
func (self *OverlayKeyring) Delete(service, user string) error
func (*OverlayKeyring) Set ¶
func (self *OverlayKeyring) Set(service, user, pass string) error
type SystemKeyring ¶
type SystemKeyring struct { }
SystemKeyring implements the system-specific keyring.
func (*SystemKeyring) Delete ¶
func (self *SystemKeyring) Delete(service, user string) error
func (*SystemKeyring) Set ¶
func (self *SystemKeyring) Set(service, user, pass string) error
Click to show internal directories.
Click to hide internal directories.