mocks

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: May 13, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockDockerClient

type MockDockerClient struct {
	PulledImages    map[string]bool
	TaggedImages    map[string]string
	PushedImages    map[string]bool
	PullErrors      map[string]error
	TagErrors       map[string]error
	PushErrors      map[string]error
	CredentialError error
	// contains filtered or unexported fields
}

MockDockerClient provides a mock implementation for testing Docker client operations

func NewMockDockerClient

func NewMockDockerClient() *MockDockerClient

NewMockDockerClient creates a new instance of MockDockerClient

func (*MockDockerClient) Close

func (m *MockDockerClient) Close() error

Close mocks the closing of resources

func (*MockDockerClient) GetImageInfo added in v0.2.0

func (m *MockDockerClient) GetImageInfo(ctx context.Context, imageName string) (*docker.ImageReference, error)

GetImageInfo implements the new method required by docker.ClientInterface

func (*MockDockerClient) PullImage

func (m *MockDockerClient) PullImage(ctx context.Context, imageName string) error

PullImage mocks the Docker image pull operation

func (*MockDockerClient) PushImage

func (m *MockDockerClient) PushImage(ctx context.Context, imageName string) error

PushImage mocks the Docker image push operation

func (*MockDockerClient) TagImage

func (m *MockDockerClient) TagImage(ctx context.Context, source, target string) error

TagImage mocks the Docker image tag operation

func (*MockDockerClient) VerifyCredentials

func (m *MockDockerClient) VerifyCredentials(ctx context.Context) error

VerifyCredentials mocks Docker registry authentication

type MockRegistryClient added in v0.2.0

type MockRegistryClient struct {
	AuthError         error
	ExistingImages    map[string]bool
	ExistingTags      map[string][]string
	ImageManifests    map[string][]byte
	ValidationResults map[string]bool
	// contains filtered or unexported fields
}

MockRegistryClient provides a mock implementation for testing registry operations

func NewMockRegistryClient added in v0.2.0

func NewMockRegistryClient() *MockRegistryClient

NewMockRegistryClient creates a new instance of MockRegistryClient

func (*MockRegistryClient) Auth added in v0.2.0

func (m *MockRegistryClient) Auth(ctx context.Context) error

Auth mocks registry authentication

func (*MockRegistryClient) Close added in v0.2.0

func (m *MockRegistryClient) Close() error

Close mocks closing the registry client

func (*MockRegistryClient) GetImageManifest added in v0.2.0

func (m *MockRegistryClient) GetImageManifest(ctx context.Context, repository string, reference string) ([]byte, error)

GetImageManifest mocks retrieving an image manifest

func (*MockRegistryClient) GetImageTags added in v0.2.0

func (m *MockRegistryClient) GetImageTags(ctx context.Context, repository string) ([]string, error)

GetImageTags mocks retrieving tags for an image

func (*MockRegistryClient) ListImages added in v0.2.0

func (m *MockRegistryClient) ListImages(ctx context.Context, namespace string) ([]string, error)

ListImages mocks listing images in a registry namespace

func (*MockRegistryClient) ValidateImage added in v0.2.0

func (m *MockRegistryClient) ValidateImage(ctx context.Context, imageRef *docker.ImageReference) (bool, error)

ValidateImage mocks checking if an image exists in the registry

Jump to

Keyboard shortcuts

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