Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ImageRef ¶
type ImageRef struct {
Registry string // e.g., "registry-1.docker.io"
Namespace string // e.g., "library" for official images, "org" for ghcr
Name string // e.g., "nginx"
Tag string // e.g., "1.25", "latest", "" if untagged
}
ImageRef represents a parsed container image reference.
func ParseImageRef ¶
ParseImageRef parses a raw image reference string into an ImageRef.
It handles the following forms:
- nginx → registry-1.docker.io/library/nginx:latest
- nginx:1.25 → registry-1.docker.io/library/nginx:1.25
- ghcr.io/org/app:v1 → ghcr.io/org/app:v1
- registry.example.com/foo/bar:2.0 → as-is
- registry.example.com:5000/foo:1.0 → registry with port
type OCIClient ¶
type OCIClient struct {
// contains filtered or unexported fields
}
OCIClient implements Registry using the OCI Distribution Spec HTTP API.
func NewOCIClient ¶
NewOCIClient creates a new OCI registry client with the given HTTP client. If httpClient is nil, http.DefaultClient is used.
func (*OCIClient) GetRemoteDigest ¶
func (c *OCIClient) GetRemoteDigest(ctx context.Context, image ImageRef, tag string) (string, error)
GetRemoteDigest returns the digest of a specific tag from the remote registry. It uses a HEAD request to the manifests endpoint and reads the Docker-Content-Digest header.
type Registry ¶
type Registry interface {
// ListTags returns all tags for an image from the remote registry.
ListTags(ctx context.Context, image ImageRef) ([]string, error)
// GetRemoteDigest returns the digest of a specific tag from the remote registry.
GetRemoteDigest(ctx context.Context, image ImageRef, tag string) (string, error)
}
Registry provides read-only access to container image registries.
Click to show internal directories.
Click to hide internal directories.