Documentation
¶
Index ¶
- Constants
- Variables
- func Delete(keyringSelection, service, user string) error
- func ExpandTilde(dir string) (string, error)
- func Get(keyringSelection, service, user string) (string, error)
- func MockInit()
- func MockInitWithError(err error)
- func Remove(key string) error
- func Set(keyringSelection, service, user, password string) error
- func TerminalPrompt(prompt string) (string, error)
- type Keyring
- type PromptFunc
Constants ¶
View Source
const (
VAULT_SELECTION_AUTO = "auto"
)
Variables ¶
View Source
var ( // ErrNotFound is the expected error if the secret isn't found in the // keyring. ErrNotFound = errors.New("secret not found in keyring") // ErrSetDataTooBig is returned if `Set` was called with too much data. // On MacOS: The combination of service, username & password should not exceed ~3000 bytes // On Windows: The service is limited to 32KiB while the password is limited to 2560 bytes // On Linux/Unix: There is no theoretical limit but performance suffers with big values (>100KiB) ErrSetDataTooBig = errors.New("data passed to Set was too big") )
View Source
var ErrUnsupportedPlatform = errors.New("unsupported platform: " + runtime.GOOS)
All of the following methods error out on unsupported platforms
Functions ¶
func ExpandTilde ¶
ExpandTilde will expand tilde (~/ or ~\ depending on OS) for the user home directory.
func MockInitWithError ¶
func MockInitWithError(err error)
MockInitWithError sets the provider to a mocked memory store that returns the given error on all operations
func TerminalPrompt ¶
Types ¶
type Keyring ¶
type Keyring interface {
// Set password in keyring for user.
Set(service, user, password string) error
// Get password from keyring given service and user name.
Get(service, user string) (string, error)
// Delete secret from keyring.
Delete(service, user string) error
}
Keyring provides a simple set/get interface for a keyring service.
type PromptFunc ¶
PromptFunc is a function used to prompt the user for a password.
func FixedStringPrompt ¶
func FixedStringPrompt(value string) PromptFunc
Source Files
¶
Click to show internal directories.
Click to hide internal directories.