Documentation
¶
Overview ¶
Package oci lists the tags of container images and reads their source labels from OCI and Docker registries, with anonymous pull tokens.
Index ¶
Constants ¶
const ( DockerHub = "docker.io" DockerHubAPI = "registry-1.docker.io" DockerHubAuth = "auth.docker.io" )
Docker Hub's names: the one in image references, the host of its registry API and the host that issues its anonymous tokens.
const ( LabelSource = "org.opencontainers.image.source" LabelVCSURL = "org.label-schema.vcs-url" )
Source label keys, newest first.
Variables ¶
var ( ErrNotAllowed = errors.New("registry not allowed") ErrBadRef = errors.New("not an image reference") )
Errors wrapped by Client methods.
Functions ¶
func DefaultRegistries ¶
func DefaultRegistries() []string
DefaultRegistries returns the registries relgap reads tags from without configuration.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client lists tags and reads source labels from image registries with anonymous tokens.
func (*Client) Check ¶
Check returns an error wrapping ErrNotAllowed unless the client may contact r's registry.
func (*Client) Source ¶
Source returns the source repository URL that the image r:tag names in its annotations or labels, or "" when it names none. It reads the manifest, then the linux/amd64 manifest of an index, then the image config, and stops at the first that has a source.
type Options ¶
type Options struct {
Registries []string // registries the client may contact; nil means [DefaultRegistries]
Scheme string // https unless a test sets http
}
Options configures New.
type Ref ¶
type Ref struct {
Registry string // as written, with docker.io for Docker Hub
Repository string // with library/ for a one-part Docker Hub name
}
Ref is an image name split into its registry and repository.