Documentation
¶
Overview ¶
Package registry implements very limited Container Registry v2 API client.
It is not universal and primarily targets Google Container Registry implementation. In particular it uses Google OAuth2 tokens for authentication.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrUnrecognizedRegistry is returned when the registry hostname is unknown to us. ErrUnrecognizedRegistry = errors.New("unrecognized registry") // ErrBadRegistryResponse is returned if the registry returns unexpected response. ErrBadRegistryResponse = errors.New("unrecognized or wrong response from the registry") )
Functions ¶
func IsManifestUnknown ¶
IsManifestUnknown return true if the given error is a MANIFEST_UNKNOWN error from the registry (perhaps wrapped).
func ValidateTag ¶
ValidateTag checks syntax of a docker tag.
A tag name must be valid ASCII and may contain lowercase and uppercase letters, digits, underscores, periods and dashes. A tag name may not start with a period or a dash and may contain a maximum of 128 characters.
Types ¶
type Client ¶
type Client struct { TokenSource oauth2.TokenSource // tokens to use for gcr.io auth // contains filtered or unexported fields }
Client is very limited Container Registry v2 API client.
It can resolve <image>:<tag> into <image>@sha256@... and can tag already uploaded images.
type Error ¶
type Error struct { StatusCode int `json:"-"` // HTTP status code RawError string `json:"-"` // set if failed to unmarshal the response body Errors []InnerError `json:"errors"` // elementary errors }
Error is returned by Registry API on errors.
type Image ¶
type Image struct { Registry string // the hostname of a registry the image came from Repo string // the name of the repo with the image Digest string // the manifest digest as "sha256:<hex>" string MediaType string // MIME type of the manifest stored there RawManifest []byte // the raw manifest body (format depends on the media type) }
Image points to some concreter docker image manifest.
type InnerError ¶
InnerError is an elementary suberror inside Error.