awgo: github.com/deanishe/awgo/keychain Index | Files

package keychain

import "github.com/deanishe/awgo/keychain"

Package keychain implements a simple interface to the macOS Keychain. Based on /usr/bin/security.

Index

Package Files

keychain.go

Variables

var (
    // Returned by Keychain.Get() and Keychain.Delete() if the specified
    // account doesn't exist.
    ErrNotFound = errors.New("password not found")
)

Specific errors returned by the API.

type Keychain Uses

type Keychain struct {
    // contains filtered or unexported fields
}

Keychain manages macOS Keychain passwords for a specific service.

func New Uses

func New(service string) *Keychain

New Keychain for specified service.

func (*Keychain) Delete Uses

func (kc *Keychain) Delete(account string) error

Delete a password from user's Keychain. Returns ErrNotFound if account doesn't exist.

func (*Keychain) Get Uses

func (kc *Keychain) Get(account string) (string, error)

Get password from user's Keychain. Returns ErrNotFound if specified account doesn't exist.

func (*Keychain) Set Uses

func (kc *Keychain) Set(account, password string) error

Set password in user's Keychain. If the account already exists, it is replaced.

Package keychain imports 7 packages (graph) and is imported by 4 packages. Updated 2019-10-19. Refresh now. Tools for package owners.