Documentation
¶
Overview ¶
Package keyring provides a cross-platform interface to keychains for password management
Currently implemented:
- OSX
- SecretService
- gnome-keychain (via "gnome_keyring" build flag)
Usage ¶
Example usage:
err := keyring.Set("libraryFoo", "jack", "sacrifice")
password, err := keyring.Get("libraryFoo", "jack")
fmt.Println(password)
Output: sacrifice
TODO
- Write Windows provider
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNotFound means the requested password was not found ErrNotFound = errors.New("Password not found") // ErrNoDefault means that no default keyring provider has been found ErrNoDefault = errors.New("No keyring provider found (check your build flags)") )
Functions ¶
func Get ¶
Get gets the password for a paricular Service and Username using the default keyring provider.
Example ¶
package main
import (
"fmt"
"github.com/tmc/keyring"
)
func main() {
keyring.Set("keyring-test", "jack", "test password")
pw, _ := keyring.Get("keyring-test", "jack")
fmt.Println("pw:", pw)
// don't ignore errors like this in your code
Output:
Types ¶
This section is empty.
Directories
¶
| Path | Synopsis |
|---|---|
|
Shows example use of the keyring package May need to be built with a platform-specific build flag to specify a provider.
|
Shows example use of the keyring package May need to be built with a platform-specific build flag to specify a provider. |
Click to show internal directories.
Click to hide internal directories.