Documentation
¶
Index ¶
- func FindStages(content string) []string
- func ParseDockerignore(dir, dockerfile string) ([]string, error)
- func SlugifyTag(tag string) string
- func Tag(registry, image, tag string) string
- type Authenticator
- type Client
- type MockDocker
- func (m *MockDocker) BuildCancel(context.Context, string) error
- func (m *MockDocker) DialHijack(context.Context, string, string, map[string][]string) (net.Conn, error)
- func (m *MockDocker) ImageBuild(_ context.Context, buildContext io.Reader, options build.ImageBuildOptions) (build.ImageBuildResponse, error)
- func (m *MockDocker) ImagePush(_ context.Context, image string, _ image.PushOptions) (io.ReadCloser, error)
- func (m *MockDocker) RegistryLogin(_ context.Context, auth registry.AuthConfig) (registry.AuthenticateOKBody, error)
- type TokenFetcher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindStages ¶
func ParseDockerignore ¶
func SlugifyTag ¶ added in v0.0.23
Types ¶
type Authenticator ¶ added in v0.2.2
type Authenticator interface {
auth.AuthServer
session.Attachable
// AddCredentials adds additional registry credentials for authentication.
AddCredentials(registryHost string, authConfig registry.AuthConfig)
}
func NewAuthenticator ¶ added in v0.2.2
func NewAuthenticator(registryHost string, authConfig registry.AuthConfig) Authenticator
NewAuthenticator creates a new authenticator with the default token fetcher.
func NewAuthenticatorWithTokenFetcher ¶ added in v0.4.0
func NewAuthenticatorWithTokenFetcher(registryHost string, authConfig registry.AuthConfig, tokenFetcher TokenFetcher) Authenticator
NewAuthenticatorWithTokenFetcher creates a new authenticator with a custom token fetcher.
type Client ¶
type Client interface {
RegistryLogin(ctx context.Context, auth registry.AuthConfig) (registry.AuthenticateOKBody, error)
ImageBuild(ctx context.Context, buildContext io.Reader, options build.ImageBuildOptions) (build.ImageBuildResponse, error)
ImagePush(ctx context.Context, image string, options image.PushOptions) (io.ReadCloser, error)
DialHijack(ctx context.Context, url, proto string, meta map[string][]string) (net.Conn, error)
BuildCancel(ctx context.Context, id string) error
}
func DefaultClient ¶ added in v0.2.27
type MockDocker ¶
type MockDocker struct {
Username string
Password string
ServerAddress string
BuildContext []io.Reader
BuildOptions []build.ImageBuildOptions
Images []string
LoginError error
BuildCount int
BuildError []error
PushError error
PushOutput *string
BrokenOutput bool
ResponseError error
ResponseBody io.Reader
}
func (*MockDocker) BuildCancel ¶ added in v0.2.1
func (m *MockDocker) BuildCancel(context.Context, string) error
func (*MockDocker) DialHijack ¶ added in v0.2.1
func (*MockDocker) ImageBuild ¶
func (m *MockDocker) ImageBuild(_ context.Context, buildContext io.Reader, options build.ImageBuildOptions) (build.ImageBuildResponse, error)
func (*MockDocker) ImagePush ¶
func (m *MockDocker) ImagePush(_ context.Context, image string, _ image.PushOptions) (io.ReadCloser, error)
func (*MockDocker) RegistryLogin ¶
func (m *MockDocker) RegistryLogin(_ context.Context, auth registry.AuthConfig) (registry.AuthenticateOKBody, error)
type TokenFetcher ¶ added in v0.4.0
type TokenFetcher func(ctx context.Context, client *http.Client, headers http.Header, to authutil.TokenOptions) (*authutil.FetchTokenResponse, error)
TokenFetcher is a function type for fetching tokens from a registry. This allows injecting mock implementations for testing.
Click to show internal directories.
Click to hide internal directories.