Documentation
¶
Index ¶
- func GetAllAuthConfigs() (map[string]types.AuthConfig, error)
- func SetFakeClient(fake Client)
- type Client
- type FakeClient
- func (client *FakeClient) DeleteImageByFilter(filter filters.Args, log log.Logger) ([]dockertypes.ImageDeleteResponseItem, error)
- func (client *FakeClient) DeleteImageByName(imageName string, log log.Logger) ([]dockertypes.ImageDeleteResponseItem, error)
- func (client *FakeClient) GetAuthConfig(registryURL string, checkCredentialsStore bool) (*dockertypes.AuthConfig, error)
- func (client *FakeClient) ImageBuild(ctx context.Context, context io.Reader, options dockertypes.ImageBuildOptions) (dockertypes.ImageBuildResponse, error)
- func (client *FakeClient) ImageBuildCLI(useBuildkit bool, context io.Reader, writer io.Writer, ...) error
- func (client *FakeClient) ImagePush(ctx context.Context, ref string, options dockertypes.ImagePushOptions) (io.ReadCloser, error)
- func (client *FakeClient) Login(registryURL, user, password string, ...) (*dockertypes.AuthConfig, error)
- func (client *FakeClient) NegotiateAPIVersion(ctx context.Context)
- func (client *FakeClient) Ping(ctx context.Context) (dockertypes.Ping, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAllAuthConfigs ¶
func GetAllAuthConfigs() (map[string]types.AuthConfig, error)
GetAllAuthConfigs returns every auth config found in the docker config
func SetFakeClient ¶
func SetFakeClient(fake Client)
SetFakeClient causes NewClient to return the given fake client. !ONLY FOR TESTING!
Types ¶
type Client ¶
type Client interface {
Ping(ctx context.Context) (dockertypes.Ping, error)
NegotiateAPIVersion(ctx context.Context)
ImageBuild(ctx context.Context, context io.Reader, options dockertypes.ImageBuildOptions) (dockertypes.ImageBuildResponse, error)
ImageBuildCLI(useBuildkit bool, context io.Reader, writer io.Writer, options dockertypes.ImageBuildOptions) error
ImagePush(ctx context.Context, ref string, options dockertypes.ImagePushOptions) (io.ReadCloser, error)
Login(registryURL, user, password string, checkCredentialsStore, saveAuthConfig, relogin bool) (*dockertypes.AuthConfig, error)
GetAuthConfig(registryURL string, checkCredentialsStore bool) (*dockertypes.AuthConfig, error)
DeleteImageByName(imageName string, log log.Logger) ([]dockertypes.ImageDeleteResponseItem, error)
DeleteImageByFilter(filter filters.Args, log log.Logger) ([]dockertypes.ImageDeleteResponseItem, error)
}
Client contains all functions required to interact with docker
type FakeClient ¶
type FakeClient struct {
AuthConfig *dockertypes.AuthConfig
}
FakeClient is a prototype for a fake docker cient for testing purposes
func (*FakeClient) DeleteImageByFilter ¶
func (client *FakeClient) DeleteImageByFilter(filter filters.Args, log log.Logger) ([]dockertypes.ImageDeleteResponseItem, error)
DeleteImageByFilter is a fake implementation
func (*FakeClient) DeleteImageByName ¶
func (client *FakeClient) DeleteImageByName(imageName string, log log.Logger) ([]dockertypes.ImageDeleteResponseItem, error)
DeleteImageByName is a fake implementation
func (*FakeClient) GetAuthConfig ¶
func (client *FakeClient) GetAuthConfig(registryURL string, checkCredentialsStore bool) (*dockertypes.AuthConfig, error)
GetAuthConfig is a fake implementation
func (*FakeClient) ImageBuild ¶
func (client *FakeClient) ImageBuild(ctx context.Context, context io.Reader, options dockertypes.ImageBuildOptions) (dockertypes.ImageBuildResponse, error)
ImageBuild is a fake implementation
func (*FakeClient) ImageBuildCLI ¶
func (client *FakeClient) ImageBuildCLI(useBuildkit bool, context io.Reader, writer io.Writer, options dockertypes.ImageBuildOptions) error
ImageBuildCLI builds an image with the docker cli
func (*FakeClient) ImagePush ¶
func (client *FakeClient) ImagePush(ctx context.Context, ref string, options dockertypes.ImagePushOptions) (io.ReadCloser, error)
ImagePush is a fake implementation
func (*FakeClient) Login ¶
func (client *FakeClient) Login(registryURL, user, password string, checkCredentialsStore, saveAuthConfig, relogin bool) (*dockertypes.AuthConfig, error)
Login is a fake implementation
func (*FakeClient) NegotiateAPIVersion ¶
func (client *FakeClient) NegotiateAPIVersion(ctx context.Context)
NegotiateAPIVersion is a fake implementation
func (*FakeClient) Ping ¶
func (client *FakeClient) Ping(ctx context.Context) (dockertypes.Ping, error)
Ping is a fake implementation
Click to show internal directories.
Click to hide internal directories.