docker

package
v0.0.0-...-3d086f3 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BasicAuthConfig

type BasicAuthConfig struct {
	// Auth is the base64 encoded "username:password" string.
	Auth *Token `json:"auth,omitempty" yaml:"auth,omitempty"`

	// Username holds the username used to gain access to a non-public image.
	Username string `json:"username" yaml:"username"`

	// Password holds the password used to gain access to a non-public image.
	Password string `json:"password" yaml:"password"`
}

BasicAuthConfig contains authorization information for basic auth.

func (BasicAuthConfig) Empty

func (ba BasicAuthConfig) Empty() bool

Empty checks if the auth information is empty.

func (*BasicAuthConfig) Validate

func (ba *BasicAuthConfig) Validate() error

Validate validates the spec.

type ImageRepoDetails

type ImageRepoDetails struct {
	BasicAuthConfig `json:",inline" yaml:",inline"`
	TokenAuthConfig `json:",inline" yaml:",inline"`

	// Repository is the namespace of the image repo.
	Repository string `json:"repository,omitempty" yaml:"repository,omitempty"`

	// ServerAddress is the auth server address.
	ServerAddress string `json:"serveraddress,omitempty" yaml:"serveraddress,omitempty"`

	// Region is the cloud region.
	Region string `json:"region,omitempty" yaml:"region,omitempty"`
}

ImageRepoDetails contains authorization information for connecting to a Registry.

func LoadImageRepoDetails

func LoadImageRepoDetails(contentOrPath string) (o ImageRepoDetails, err error)

LoadImageRepoDetails tries to parse a file path or file content and returns an instance of ImageRepoDetails.

func NewImageRepoDetails

func NewImageRepoDetails(repo string) (o ImageRepoDetails, err error)

NewImageRepoDetails tries to parse as json or basic repository path and returns an instance of ImageRepoDetails.

func (ImageRepoDetails) AuthEqual

func (rid ImageRepoDetails) AuthEqual(r ImageRepoDetails) bool

AuthEqual compares if the provided one equals to current repository detail.

func (ImageRepoDetails) Content

func (rid ImageRepoDetails) Content() string

Content returns the json marshalled string with raw credentials.

func (ImageRepoDetails) Empty

func (rid ImageRepoDetails) Empty() bool

Empty checks if the auth information is empty.

func (ImageRepoDetails) IsPrivate

func (rid ImageRepoDetails) IsPrivate() bool

IsPrivate checks if the repository detail is private.

func (ImageRepoDetails) SecretData

func (rid ImageRepoDetails) SecretData() ([]byte, error)

SecretData returns secret data format.

func (*ImageRepoDetails) Validate

func (rid *ImageRepoDetails) Validate() error

Validate validates the spec.

type Token

type Token struct {
	// Value is the value of the token.
	Value string

	// ExpiresAt is the unix time in seconds and milliseconds when the authorization token expires.
	ExpiresAt *time.Time
}

Token defines a token value with expiration time.

func NewToken

func NewToken(value string) *Token

NewToken creates a Token.

func (*Token) Content

func (t *Token) Content() string

Content returns the raw content of the token.

func (*Token) Empty

func (t *Token) Empty() bool

Empty checks if the auth information is empty.

func (Token) MarshalJSON

func (t Token) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface.

func (*Token) String

func (t *Token) String() string

String returns the string value.

func (*Token) UnmarshalJSON

func (t *Token) UnmarshalJSON(value []byte) error

UnmarshalJSON implements the json.Unmarshaller interface.

type TokenAuthConfig

type TokenAuthConfig struct {
	Email string `json:"email,omitempty" yaml:"email,omitempty"`

	// IdentityToken is used to authenticate the user and get
	// an access token for the registry.
	IdentityToken *Token `json:"identitytoken,omitempty" yaml:"identitytoken,omitempty"`

	// RegistryToken is a bearer token to be sent to a registry
	RegistryToken *Token `json:"registrytoken,omitempty" yaml:"registrytoken,omitempty"`
}

TokenAuthConfig contains authorization information for token auth. Juju does not support the docker credential helper because k8s does not support it either. https://kubernetes.io/docs/concepts/containers/images/#configuring-nodes-to-authenticate-to-a-private-registry

func (TokenAuthConfig) Empty

func (ac TokenAuthConfig) Empty() bool

Empty checks if the auth information is empty.

func (*TokenAuthConfig) Validate

func (ac *TokenAuthConfig) Validate() error

Validate validates the spec.

Directories

Path Synopsis
internal/mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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