client

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 12, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DockerClient

type DockerClient struct {
	Client     *client.Client
	AuthStr    string
	Username   string
	Password   string
	Repository string
	RetryCount int
	RetryDelay time.Duration
}

DockerClient encapsulates Docker operations with enhanced error handling and retry logic

func NewDockerClient

func NewDockerClient(username, password, repository string) (*DockerClient, error)

NewDockerClient creates a new Docker client with authentication

func (*DockerClient) Close

func (d *DockerClient) Close() error

Close closes the Docker client

func (*DockerClient) PullImage

func (d *DockerClient) PullImage(ctx context.Context, imageName string) error

PullImage pulls a Docker image with retry logic

func (*DockerClient) PushImage

func (d *DockerClient) PushImage(ctx context.Context, imageName string) error

PushImage pushes a Docker image with retry logic

func (*DockerClient) TagImage

func (d *DockerClient) TagImage(ctx context.Context, source, target string) error

TagImage tags a Docker image

func (*DockerClient) VerifyCredentials

func (d *DockerClient) VerifyCredentials(ctx context.Context) error

VerifyCredentials verifies Docker registry credentials

type DockerClientInterface

type DockerClientInterface interface {
	PullImage(ctx context.Context, imageName string) error
	TagImage(ctx context.Context, source, target string) error
	PushImage(ctx context.Context, imageName string) error
	VerifyCredentials(ctx context.Context) error
	Close() error
}

DockerClientInterface defines the interface for Docker operations

Jump to

Keyboard shortcuts

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