Documentation ¶
Overview ¶
Package secret defines an interface to a database storing secrets, such as passwords and API keys.
TODO(rsc): Consider adding a basic key: value text file format besides netrc.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ReadOnlyMap ¶
A ReadOnlyMap is a read-only DB. Calling [Set] panics.
func Netrc ¶
func Netrc() ReadOnlyMap
Netrc returns a read-only secret database initialized by the content of $HOME/.netrc, if it exists. A line in .netrc of the form
machine name login user password pass
causes Get("name") to return "user:pass". Lines later in .netrc take priority over lines earlier in .netrc.
If the environment $NETRC is set and non-empty, the file it names is used instead of $HOME/.netrc.
Click to show internal directories.
Click to hide internal directories.