config

package
v2.0.0-...-c472316 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 12, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidConfigFormat = errors.New("invalid config format")

ErrInvalidConfigFormat is returned when the config format is invalid.

Functions

This section is empty.

Types

type AuthConfig

type AuthConfig struct {
	// Auth is a base64-encoded string of "{username}:{password}".
	Auth string `json:"auth,omitempty"`
	// IdentityToken is used to authenticate the user and get an access token
	// for the registry.
	IdentityToken string `json:"identitytoken,omitempty"`
	// RegistryToken is a bearer token to be sent to a registry.
	RegistryToken string `json:"registrytoken,omitempty"`

	Username string `json:"username,omitempty"` // legacy field for compatibility
	Password string `json:"password,omitempty"` // legacy field for compatibility
}

AuthConfig contains authorization information for connecting to a Registry. References:

func NewAuthConfig

func NewAuthConfig(cred auth.Credential) AuthConfig

NewAuthConfig creates an authConfig based on cred.

func (AuthConfig) Credential

func (ac AuthConfig) Credential() (auth.Credential, error)

Credential returns an auth.Credential based on ac.

type Config

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

Config represents a docker configuration file. References:

func Load

func Load(configPath string) (*Config, error)

Load loads Config from the given config path.

func (*Config) CredentialsStore

func (cfg *Config) CredentialsStore() string

CredentialsStore returns the configured credentials store.

func (*Config) DeleteCredential

func (cfg *Config) DeleteCredential(serverAddress string) error

DeleteAuthConfig deletes the corresponding credential for serverAddress.

func (*Config) GetCredential

func (cfg *Config) GetCredential(serverAddress string) (auth.Credential, error)

GetAuthConfig returns an auth.Credential for serverAddress.

func (*Config) GetCredentialHelper

func (cfg *Config) GetCredentialHelper(serverAddress string) string

GetCredentialHelper returns the credential helpers for serverAddress.

func (*Config) IsAuthConfigured

func (cfg *Config) IsAuthConfigured() bool

IsAuthConfigured returns whether there is authentication configured in this config file or not.

func (*Config) Path

func (cfg *Config) Path() string

Path returns the path to the config file.

func (*Config) PutCredential

func (cfg *Config) PutCredential(serverAddress string, cred auth.Credential) error

PutAuthConfig puts cred for serverAddress.

func (*Config) SetCredentialsStore

func (cfg *Config) SetCredentialsStore(credsStore string) error

SetCredentialsStore puts the configured credentials store.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL