keychain

package
v0.5.0-beta.4 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: PostgreSQL Imports: 6 Imported by: 0 modules, 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

Overview

Package keychain stores the Starfleet client secret in the operating system's credential store: macOS Keychain, the Secret Service on Linux, Credential Manager on Windows.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNotFound reports that the store holds no entry for the account.
	ErrNotFound = errors.New("keychain: no entry")
	// ErrUnavailable reports that the store could not be used at all.
	ErrUnavailable = errors.New("keychain: unavailable")
)

Functions

func Account

func Account(profile, configPath string) string

Account names the entry for one profile of one config file. The path is part of it so --config other.yaml with a same-named profile cannot read another file's secret.

Types

type Fake

type Fake struct {
	Err error

	// Sets and Deletes count calls, failed ones included.
	Sets, Deletes int
	// contains filtered or unexported fields
}

Fake is an in-memory Store for tests. A non-nil Err makes every call fail with it, wrapped as ErrUnavailable.

func (*Fake) Delete

func (f *Fake) Delete(account string) error

Delete removes the entry.

func (*Fake) Get

func (f *Fake) Get(account string) (string, error)

Get returns the stored secret.

func (*Fake) Set

func (f *Fake) Set(account, secret string) error

Set stores secret under account.

type Store

type Store interface {
	Get(account string) (string, error)
	Set(account, secret string) error
	Delete(account string) error
}

Store is a credential store keyed by account.

func OS

func OS() Store

OS returns the operating system's store.

Jump to

Keyboard shortcuts

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