package credentials
import "github.com/docker/docker-credential-helpers/credentials"
Index ¶
- func Erase(helper Helper, reader io.Reader) error
- func Get(helper Helper, reader io.Reader, writer io.Writer) error
- func HandleCommand(helper Helper, key string, in io.Reader, out io.Writer) error
- func IsErrCredentialsNotFound(err error) bool
- func IsErrCredentialsNotFoundMessage(err string) bool
- func NewErrCredentialsNotFound() error
- func Serve(helper Helper)
- func Store(helper Helper, reader io.Reader) error
- type Credentials
- type Helper
Functions ¶
func Erase ¶
Erase removes credentials from the store. The reader must contain the server URL to remove.
func Get ¶
Get retrieves the credentials for a given server url. The reader must contain the server URL to search. The writer is used to write the JSON serialization of the credentials.
func HandleCommand ¶
HandleCommand uses a helper and a key to run a credential action.
func IsErrCredentialsNotFound ¶
IsErrCredentialsNotFound returns true if the error was caused by not having a set of credentials in a store.
func IsErrCredentialsNotFoundMessage ¶
IsErrCredentialsNotFoundMessage returns true if the error was caused by not having a set of credentials in a store.
This function helps to check messages returned by an external program via its standard output.
func NewErrCredentialsNotFound ¶
func NewErrCredentialsNotFound() error
NewErrCredentialsNotFound creates a new error for when the credentials are not in the store.
func Serve ¶
func Serve(helper Helper)
Serve initializes the credentials helper and parses the action argument. This function is designed to be called from a command line interface. It uses os.Args[1] as the key for the action. It uses os.Stdin as input and os.Stdout as output. This function terminates the program with os.Exit(1) if there is an error.
func Store ¶
Store uses a helper and an input reader to save credentials. The reader must contain the JSON serialization of a Credentials struct.
Types ¶
type Credentials ¶
Credentials holds the information shared between docker and the credentials store.
type Helper ¶
type Helper interface { // Add appends credentials to the store. Add(*Credentials) error // Delete removes credentials from the store. Delete(serverURL string) error // Get retrieves credentials from the store. // It returns username and secret as strings. Get(serverURL string) (string, string, error) }
Helper is the interface a credentials store helper must implement.
Source Files ¶
credentials.go error.go helper.go
- Version
- v0.3.0
- Published
- Jun 1, 2016
- Platform
- js/wasm
- Imports
- 7 packages
- Last checked
- 6 hours ago –
Tools for package owners.