Documentation ¶
Index ¶
- Constants
- Variables
- func Log(format string, args ...interface{})
- func ParseValueAndParams(header string) (value string, params map[string]string)
- func Quiet(format string, args ...interface{})
- type AuthorizationChallenge
- type BasicTransport
- type ClientError
- type ErrorTransport
- type HttpStatusError
- type LogfCallback
- type Registry
- func (registry *Registry) DeleteManifest(repository string, digest digest.Digest) error
- func (registry *Registry) DownloadLayer(repository string, digest digest.Digest) (io.ReadCloser, error)
- func (registry *Registry) HasLayer(repository string, digest digest.Digest) (bool, error)
- func (registry *Registry) ImageIndex(repository, reference string) (*manifestlist.DeserializedManifestList, error)
- func (registry *Registry) LayerMetadata(repository string, digest digest.Digest) (distribution.Descriptor, error)
- func (registry *Registry) Manifest(repository, reference string) (*schema1.SignedManifest, error)
- func (registry *Registry) ManifestDigest(repository, reference string) (digest.Digest, string, error)
- func (registry *Registry) ManifestList(repository, reference string) (*manifestlist.DeserializedManifestList, error)
- func (registry *Registry) ManifestOCI(repository, reference string) (*ocischema.DeserializedManifest, error)
- func (registry *Registry) ManifestV2(repository, reference string) (*schema2.DeserializedManifest, error)
- func (registry *Registry) Ping() error
- func (registry *Registry) PutManifest(repository, reference string, manifest distribution.Manifest) error
- func (registry *Registry) Repositories() ([]string, error)
- func (registry *Registry) SignedManifest(repository, reference string) (*schema1.SignedManifest, error)
- func (registry *Registry) Tags(repository string) (tags []string, err error)
- func (registry *Registry) UploadLayer(repository string, digest digest.Digest, content io.Reader) error
- type TokenTransport
- type Transport
Constants ¶
const ( // MediaTypeImageManifest specifies the media type for an image manifest. MediaTypeImageManifest = "application/vnd.oci.image.manifest.v1+json" // MediaTypeImageIndex specifies the media type for an image index. MediaTypeImageIndex = "application/vnd.oci.image.index.v1+json" )
Opt to define these constants here instead of importing github.com/opencontainers/image-spec/specs-go/v1 to ensure we use the docker/distribution library for unmarshalling purposes.
Variables ¶
var (
ErrNoMorePages = errors.New("No more pages")
)
Functions ¶
func Log ¶
func Log(format string, args ...interface{})
* Pass log messages along to Go's "log" module.
func ParseValueAndParams ¶
ParseValueAndParams takes in a header string and parses the token out of it
Types ¶
type AuthorizationChallenge ¶
AuthorizationChallenge carries information from a WWW-Authenticate response header.
type BasicTransport ¶
type ClientError ¶
type ClientError struct {
// contains filtered or unexported fields
}
func NewClientError ¶
func NewClientError(code int, err error) *ClientError
func (*ClientError) Code ¶
func (c *ClientError) Code() int
func (*ClientError) Error ¶
func (c *ClientError) Error() string
func (*ClientError) OrigErr ¶
func (c *ClientError) OrigErr() error
type ErrorTransport ¶
type ErrorTransport struct {
Transport
}
type HttpStatusError ¶
type HttpStatusError struct { Response *http.Response Body []byte // Copied from `Response.Body` to avoid problems with unclosed bodies later. Nobody calls `err.Response.Body.Close()`, ever. }
func (*HttpStatusError) Error ¶
func (err *HttpStatusError) Error() string
type LogfCallback ¶
type LogfCallback func(format string, args ...interface{})
type Registry ¶
type Registry struct { URL string Client *http.Client Transport Transport Logf LogfCallback }
func New ¶
* Create a new Registry with the given URL and credentials, then Ping()s it * before returning it to verify that the registry is available. * * You can, alternately, construct a Registry manually by populating the fields. * This passes http.DefaultTransport to WrapTransport when creating the * http.Client.
func NewFromTransport ¶
func NewFromTransport(registryUrl string, transport Transport, logf LogfCallback) (*Registry, error)
func NewInsecure ¶
* Create a new Registry, as with New, using an http.Transport that disables * SSL certificate verification.
func (*Registry) DeleteManifest ¶
func (*Registry) DownloadLayer ¶
func (registry *Registry) DownloadLayer(repository string, digest digest.Digest) (io.ReadCloser, error)
func (*Registry) ImageIndex ¶
func (registry *Registry) ImageIndex(repository, reference string) (*manifestlist.DeserializedManifestList, error)
func (*Registry) LayerMetadata ¶
func (registry *Registry) LayerMetadata(repository string, digest digest.Digest) (distribution.Descriptor, error)
func (*Registry) Manifest ¶
func (registry *Registry) Manifest(repository, reference string) (*schema1.SignedManifest, error)
func (*Registry) ManifestDigest ¶
func (*Registry) ManifestList ¶
func (registry *Registry) ManifestList(repository, reference string) (*manifestlist.DeserializedManifestList, error)
func (*Registry) ManifestOCI ¶
func (registry *Registry) ManifestOCI(repository, reference string) (*ocischema.DeserializedManifest, error)
func (*Registry) ManifestV2 ¶
func (registry *Registry) ManifestV2(repository, reference string) (*schema2.DeserializedManifest, error)
func (*Registry) PutManifest ¶
func (registry *Registry) PutManifest(repository, reference string, manifest distribution.Manifest) error
func (*Registry) Repositories ¶
func (*Registry) SignedManifest ¶
func (registry *Registry) SignedManifest(repository, reference string) (*schema1.SignedManifest, error)
type TokenTransport ¶
type TokenTransport struct { Transport http.RoundTripper Username string Password string // contains filtered or unexported fields }
func (*TokenTransport) GetToken ¶
func (t *TokenTransport) GetToken() string
GetToken returns the current token used to access the registry
type Transport ¶
type Transport interface { http.RoundTripper GetToken() string }
Transport is the interface that all transports must implement so that a token can be retrieved from the registry
func WrapTransport ¶
func WrapTransport(transport http.RoundTripper, url, username, password string) Transport
* Given an existing http.RoundTripper such as http.DefaultTransport, build the * transport stack necessary to authenticate to the Docker registry API. This * adds in support for OAuth bearer tokens and HTTP Basic auth, and sets up * error handling this library relies on.