View definition

func NewAuthConfigurations

Defined in github.com/fsouza/go-dockerclient/auth.go

Description

NewAuthConfigurations returns AuthConfigurations from a JSON encoded string in the same format as the .dockercfg file.

Examples

		return nil, err
	}
	return NewAuthConfigurations(r)
}

	auth := base64.StdEncoding.EncodeToString([]byte("user:pa:ss"))
	read := strings.NewReader(fmt.Sprintf(`{"docker.io":{"auth":"%s","email":"[email protected]"}}`, auth))
	ac, err := NewAuthConfigurations(read)
	if err != nil {
		t.Error(err)

	auth := base64.StdEncoding.EncodeToString([]byte("userpass"))
	read := strings.NewReader(fmt.Sprintf(`{"docker.io":{"auth":"%s","email":"[email protected]"}}`, auth))
	ac, err := NewAuthConfigurations(read)
	if err != ErrCannotParseDockercfg {
		t.Errorf("Incorrect error returned %v\n", err)

NewAuthConfigurations is referenced in 2 repositories

github.com/fsouza/go-dockerclient github.com/arschles/gci