Documentation ¶
Index ¶
- Variables
- func Log(format string, args ...interface{})
- func Quiet(format string, args ...interface{})
- type BasicTransport
- type CustomTransport
- type ErrorTransport
- type Image
- type LogfCallback
- type Opt
- type Registry
- func (r *Registry) Catalog(ctx context.Context, u string) ([]string, error)
- func (r *Registry) Delete(ctx context.Context, repository string, digest digest.Digest) (err error)
- func (r *Registry) Digest(ctx context.Context, image Image) (digest.Digest, error)
- func (r *Registry) DownloadLayer(ctx context.Context, repository string, digest digest.Digest) (io.ReadCloser, error)
- func (r *Registry) HasLayer(ctx context.Context, repository string, digest digest.Digest) (bool, error)
- func (r *Registry) Headers(ctx context.Context, uri string) (map[string]string, error)
- func (r *Registry) Manifest(ctx context.Context, repository, ref string) (distribution.Manifest, error)
- func (r *Registry) ManifestList(ctx context.Context, repository, ref string) (manifestlist.ManifestList, error)
- func (r *Registry) ManifestV1(ctx context.Context, repository, ref string) (schema1.SignedManifest, error)
- func (r *Registry) ManifestV2(ctx context.Context, repository, ref string) (schema2.Manifest, error)
- func (r *Registry) Ping(ctx context.Context) error
- func (r *Registry) Pingable() bool
- func (r *Registry) PutManifest(ctx context.Context, repository, ref string, manifest distribution.Manifest) error
- func (r *Registry) Tags(ctx context.Context, repository string) ([]string, error)
- func (r *Registry) Token(ctx context.Context, url string) (string, error)
- func (r *Registry) UploadLayer(ctx context.Context, repository string, digest reference.Reference, ...) error
- type TokenTransport
Constants ¶
This section is empty.
Variables ¶
var ( // ErrBasicAuth indicates that the repository requires basic rather than token authentication. ErrBasicAuth = errors.New("basic auth required") )
var ( // ErrUnexpectedSchemaVersion a specific schema version was requested, but was not returned ErrUnexpectedSchemaVersion = errors.New("recieved a different schema version than expected") )
Functions ¶
Types ¶
type BasicTransport ¶
type BasicTransport struct { Transport http.RoundTripper URL string Username string Password string }
BasicTransport defines the data structure for authentication via basic auth.
type CustomTransport ¶ added in v0.14.2
type CustomTransport struct { Transport http.RoundTripper Headers map[string]string }
CustomTransport defines the data structure for custom http.Request options.
type ErrorTransport ¶
type ErrorTransport struct {
Transport http.RoundTripper
}
ErrorTransport defines the data structure for returning errors from the round tripper.
type Image ¶ added in v0.14.0
type Image struct { Domain string Path string Tag string Digest digest.Digest // contains filtered or unexported fields }
Image holds information about an image.
func ParseImage ¶ added in v0.14.0
ParseImage returns an Image struct with all the values filled in for a given image.
func (Image) Reference ¶ added in v0.14.0
Reference returns either the digest if it is non-empty or the tag for the image.
type LogfCallback ¶
type LogfCallback func(format string, args ...interface{})
LogfCallback is the callback for formatting logs.
type Opt ¶ added in v0.13.1
type Opt struct { Domain string Insecure bool Debug bool SkipPing bool NonSSL bool Timeout time.Duration Headers map[string]string }
Opt holds the options for a new registry.
type Registry ¶
type Registry struct { URL string Domain string Username string Password string Client *http.Client Logf LogfCallback Opt Opt }
Registry defines the client for retrieving information from the registry API.
func (*Registry) Delete ¶
Delete removes a repository digest from the registry. https://docs.docker.com/registry/spec/api/#deleting-an-image
func (*Registry) DownloadLayer ¶
func (r *Registry) DownloadLayer(ctx context.Context, repository string, digest digest.Digest) (io.ReadCloser, error)
DownloadLayer downloads a specific layer by digest for a repository.
func (*Registry) HasLayer ¶
func (r *Registry) HasLayer(ctx context.Context, repository string, digest digest.Digest) (bool, error)
HasLayer returns if the registry contains the specific digest for a repository.
func (*Registry) Headers ¶ added in v0.13.2
Headers returns the authorization headers for a specific uri.
func (*Registry) Manifest ¶
func (r *Registry) Manifest(ctx context.Context, repository, ref string) (distribution.Manifest, error)
Manifest returns the manifest for a specific repository:tag.
func (*Registry) ManifestList ¶
func (r *Registry) ManifestList(ctx context.Context, repository, ref string) (manifestlist.ManifestList, error)
ManifestList gets the registry v2 manifest list.
func (*Registry) ManifestV1 ¶
func (r *Registry) ManifestV1(ctx context.Context, repository, ref string) (schema1.SignedManifest, error)
ManifestV1 gets the registry v1 manifest.
func (*Registry) ManifestV2 ¶
func (r *Registry) ManifestV2(ctx context.Context, repository, ref string) (schema2.Manifest, error)
ManifestV2 gets the registry v2 manifest.
func (*Registry) PutManifest ¶ added in v0.14.0
func (r *Registry) PutManifest(ctx context.Context, repository, ref string, manifest distribution.Manifest) error
PutManifest calls a PUT for the specific manifest for an image.
type TokenTransport ¶
type TokenTransport struct { Transport http.RoundTripper Username string Password string }
TokenTransport defines the data structure for authentication via tokens.