Documentation ¶
Index ¶
Constants ¶
const ( // DefaultRegistry is the registry name that will be used if no registry // provided and the default is not overridden. DefaultRegistry = "index.docker.io" // DefaultTag is the tag name that will be used if no tag provided and the // default is not overridden. DefaultTag = "latest" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Auth ¶
type Auth struct { Username string `json:"username"` Password string `json:"password"` Email string `json:"email"` }
Auth the auth of image registry
type DockerConfig ¶
type DockerConfig map[string]DockerConfigEntry
DockerConfig represents the config file used by the docker CLI. This config that represents the credentials that should be used when pulling images from specific image repositories.
type DockerConfigEntry ¶
DockerConfigEntry wraps a docker config as an entry
type ImageRegistry ¶
type ImageRegistry struct { Registry string `json:"registry"` Auth Auth `json:"auth"` Insecure bool `json:"insecure"` UseHTTP bool `json:"useHTTP"` }
ImageRegistry the request body for validating image registry
type Option ¶
type Option func(*options)
Option is a functional option
func WithAuth ¶
func WithAuth(auth authn.Authenticator) Option
WithAuth is a functional option for overriding the default authenticator for remote operations.
func WithContext ¶
WithContext is a functional option for setting the context.
func WithPlatform ¶
WithPlatform is an Option to specify the platform.
func WithTransport ¶
func WithTransport(t http.RoundTripper) Option
WithTransport is a functional option for overriding the default transport for remote operations.
type RegistryHelper ¶
type RegistryHelper interface { // Auth check if secret has correct credential to authenticate with remote registry Auth(ctx context.Context, imageRegistry *ImageRegistry) (bool, error) }
RegistryHelper provides helper functions for common Registry operations
func NewRegistryHelper ¶
func NewRegistryHelper() RegistryHelper
NewRegistryHelper creates a registry helper
type SecretAuthenticator ¶
type SecretAuthenticator interface { Options() []Option Auth(ctx context.Context) (bool, error) Authorization() (*authn.AuthConfig, error) }
SecretAuthenticator provides helper functions for secret authenticator operations
func NewSecretAuthenticator ¶
func NewSecretAuthenticator(imageRegistry *ImageRegistry) (SecretAuthenticator, error)
NewSecretAuthenticator creates a secret authenticator