GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Why Go
  • Case Studies
  • Use Cases
  • Security
  • Learn
  • Effective Go
  • Go User Manual
  • Standard library
  • Release Notes
  • API
  • Packages
  • Recorded Talks
  • Meetups
  • Conferences

This view

  • Original page
  • New address

GeezerVison is showing pkg.go.dev — client package - github.com/docker/docker-credential-helpers/client - Go Packages

Details

  • checked Valid go.mod file

    The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.

  • checked Redistributable license

    Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.

  • checked Tagged version

    Modules with tagged versions give importers more predictable builds.

  • unchecked Stable version

    When a project reaches major version v1 it is considered stable.

  • Learn more about best practices

Repository

github.com/docker/docker-credential-helpers

Links

  • Open Source Insights Logo Open Source Insights

Documentation ¶

Index ¶

  • func Erase(program ProgramFunc, serverURL string) error
  • func Get(program ProgramFunc, serverURL string) (*credentials.Credentials, error)
  • func List(program ProgramFunc) (map[string]string, error)
  • func Store(program ProgramFunc, creds *credentials.Credentials) error
  • type Program
  • type ProgramFunc
    • func NewShellProgramFunc(command string) ProgramFunc
    • func NewShellProgramFuncWithEnv(command string, env *map[string]string) ProgramFunc
  • type Shell
    • func (s *Shell) Input(in io.Reader)
    • func (s *Shell) Output() ([]byte, error)

Examples ¶

  • Erase
  • Get
  • Store

Constants ¶

This section is empty.

Variables ¶

This section is empty.

Functions ¶

func Erase ¶

func Erase(program ProgramFunc, serverURL string) error

Erase executes a program to remove the server credentials from the native store.

Example ¶
p := NewShellProgramFunc("docker-credential-pass")

if err := Erase(p, "https://registry.example.com"); err != nil {
	_, _ = fmt.Println(err)
}

func Get ¶

func Get(program ProgramFunc, serverURL string) (*credentials.Credentials, error)

Get executes an external program to get the credentials from a native store.

Example ¶
p := NewShellProgramFunc("docker-credential-pass")

creds, err := Get(p, "https://registry.example.com")
if err != nil {
	_, _ = fmt.Println(err)
}

_, _ = fmt.Printf("Got credentials for user `%s` in `%s`\n", creds.Username, creds.ServerURL)

func List ¶ added in v0.4.0

func List(program ProgramFunc) (map[string]string, error)

List executes a program to list server credentials in the native store.

func Store ¶

func Store(program ProgramFunc, creds *credentials.Credentials) error

Store uses an external program to save credentials.

Example ¶
p := NewShellProgramFunc("docker-credential-pass")

c := &credentials.Credentials{
	ServerURL: "https://registry.example.com",
	Username:  "exampleuser",
	Secret:    "my super secret token",
}

if err := Store(p, c); err != nil {
	_, _ = fmt.Println(err)
}

Types ¶

type Program ¶

type Program interface {
	Output() ([]byte, error)
	Input(in io.Reader)
}

Program is an interface to execute external programs.

type ProgramFunc ¶

type ProgramFunc func(args ...string) Program

ProgramFunc is a type of function that initializes programs based on arguments.

func NewShellProgramFunc ¶

func NewShellProgramFunc(command string) ProgramFunc

NewShellProgramFunc creates a ProgramFunc to run command in a Shell.

func NewShellProgramFuncWithEnv ¶ added in v0.6.0

func NewShellProgramFuncWithEnv(command string, env *map[string]string) ProgramFunc

NewShellProgramFuncWithEnv creates a ProgramFunc tu run command in a Shell with the given environment variables.

type Shell ¶

type Shell struct {
	// contains filtered or unexported fields
}

Shell invokes shell commands to talk with a remote credentials-helper.

func (*Shell) Input ¶

func (s *Shell) Input(in io.Reader)

Input sets the input to send to a remote credentials-helper.

func (*Shell) Output ¶

func (s *Shell) Output() ([]byte, error)

Output returns responses from the remote credentials-helper.

Source Files ¶

View all Source files
  • client.go
  • command.go
Click to show internal directories.
Click to hide internal directories.
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.