keystore

package
v0.10.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 13, 2026 License: MIT Imports: 8 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrLocked reports an OS keyring that exists but is locked. Reading or
	// writing it would wait for an unlock prompt, which never comes without a
	// desktop session, so enbu asks the person to unlock it instead.
	ErrLocked = errors.New("OS keyring is locked")
	// ErrNoKeyring reports a device without a usable OS keyring: no Secret
	// Service on Linux, or no default collection to keep keys in.
	ErrNoKeyring = errors.New("no OS keyring")
)

Functions

This section is empty.

Types

type Backend

type Backend interface {
	Store(service, key string, secret []byte) error
	Load(service, key string) ([]byte, error)
	Delete(service, key string) error
}

func New

func New() Backend

New returns the backend for the GitHub token: the OS keyring. There is no plaintext file backend; a keyring that is missing or locked fails each operation instead.

type KeyringBackend

type KeyringBackend struct{ Clock clock.Clock }

func (*KeyringBackend) Delete

func (k *KeyringBackend) Delete(service, key string) error

func (*KeyringBackend) Load

func (k *KeyringBackend) Load(service, key string) ([]byte, error)

func (*KeyringBackend) Probe

func (k *KeyringBackend) Probe(ctx context.Context) error

Probe checks that the OS keyring can store and load keys now, without writing a key and without waiting for an unlock prompt.

func (*KeyringBackend) Store

func (k *KeyringBackend) Store(service, key string, secret []byte) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL