Documentation
¶
Index ¶
- type DockerHubRegistry
- func (r *DockerHubRegistry) Auth(ctx context.Context) error
- func (r *DockerHubRegistry) Close() error
- func (r *DockerHubRegistry) GetImageManifest(ctx context.Context, repository string, reference string) ([]byte, error)
- func (r *DockerHubRegistry) GetImageTags(ctx context.Context, repository string) ([]string, error)
- func (r *DockerHubRegistry) ListImages(ctx context.Context, namespace string) ([]string, error)
- func (r *DockerHubRegistry) ValidateImage(ctx context.Context, imageRef *docker.ImageReference) (bool, error)
- type Provider
- type RegistryConfig
- type RegistryInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DockerHubRegistry ¶
type DockerHubRegistry struct {
// contains filtered or unexported fields
}
DockerHubRegistry implements the RegistryInterface for Docker Hub
func NewDockerHubRegistry ¶
func NewDockerHubRegistry(config RegistryConfig) *DockerHubRegistry
NewDockerHubRegistry creates a new Docker Hub registry client
func (*DockerHubRegistry) Auth ¶
func (r *DockerHubRegistry) Auth(ctx context.Context) error
Auth authenticates with Docker Hub
func (*DockerHubRegistry) Close ¶
func (r *DockerHubRegistry) Close() error
Close releases resources associated with the registry client
func (*DockerHubRegistry) GetImageManifest ¶
func (r *DockerHubRegistry) GetImageManifest(ctx context.Context, repository string, reference string) ([]byte, error)
GetImageManifest gets the manifest for an image
func (*DockerHubRegistry) GetImageTags ¶
GetImageTags gets all tags for an image in the registry
func (*DockerHubRegistry) ListImages ¶
ListImages lists available images in the given namespace
func (*DockerHubRegistry) ValidateImage ¶
func (r *DockerHubRegistry) ValidateImage(ctx context.Context, imageRef *docker.ImageReference) (bool, error)
ValidateImage checks if an image exists in the registry
type Provider ¶
type Provider string
Provider represents the type of container registry
const ( // DockerHub represents the Docker Hub registry DockerHub Provider = "dockerhub" // DockerIO represents the Docker.io registry DockerIO Provider = "docker.io" // ECR represents Amazon's Elastic Container Registry ECR Provider = "ecr" // GCR represents Google's Container Registry GCR Provider = "gcr" // ACR represents Azure's Container Registry ACR Provider = "acr" // Custom represents a custom registry Custom Provider = "custom" )
type RegistryConfig ¶
type RegistryConfig struct {
Provider Provider
URL string
Username string
Password string
AccessToken string
RefreshToken string
TokenExpiration time.Time
Insecure bool
SkipVerify bool
}
RegistryConfig holds configuration for connecting to a registry
type RegistryInterface ¶
type RegistryInterface interface {
// Auth authenticates with the registry
Auth(ctx context.Context) error
// ListImages lists available images
ListImages(ctx context.Context, namespace string) ([]string, error)
// GetImageTags gets all tags for an image
GetImageTags(ctx context.Context, repository string) ([]string, error)
// GetImageManifest gets the image manifest
GetImageManifest(ctx context.Context, repository string, reference string) ([]byte, error)
// ValidateImage checks if an image exists in the registry
ValidateImage(ctx context.Context, imageRef *docker.ImageReference) (bool, error)
// Close releases any resources associated with the registry
Close() error
}
RegistryInterface defines operations for interacting with a container registry