Documentation
¶
Overview ¶
Package auto picks the credential backend for the platform it is built for.
It exists for multiplatform CLIs that just want "whatever this machine has". Code that knows its environment should skip it and inject the backend directly — a browser application imports keyring/browser, not this package.
Index ¶
Constants ¶
const ( // ErrGoModNotFound is returned when no go.mod exists in dir or any parent. ErrGoModNotFound = keyring.Error("keyring/auto: no go.mod found walking up from the given directory") // ErrNoModuleDirective is returned when go.mod has no `module` line. ErrNoModuleDirective = keyring.Error("keyring/auto: go.mod has no module directive") )
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New() *keyring.KeyManager
New is keyring.New with the platform's provider already chosen.
Types ¶
type Keyring ¶
Keyring is an alias so callers need only this import.
func NewKeyring ¶
NewKeyring is keyring.NewKeyring with the platform's provider already chosen.
func OpenForModule ¶ added in v0.2.3
OpenForModule opens (auto-selecting the platform's provider, same as OpenKeyring) a Keyring scoped to the Go module found by walking up from dir — pass "." for the current working directory. The module's own path is the service namespace: it is already globally unique, so two different projects' identically named keys never collide, and no project has to remember to declare a service name of its own.
func OpenKeyring ¶
OpenKeyring is keyring.OpenKeyring with the platform's provider already chosen.