registry

package
v0.13.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 12, 2018 License: MIT Imports: 21 Imported by: 34 modules, 45 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Log

func Log(format string, args ...interface{})

Log passes log messages to the logging package.

func Quiet

func Quiet(format string, args ...interface{})

Quiet discards logs silently.

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.

func (*BasicTransport) RoundTrip

func (t *BasicTransport) RoundTrip(req *http.Request) (*http.Response, error)

RoundTrip defines the round tripper for basic auth transport.

type ErrorTransport

type ErrorTransport struct {
	Transport http.RoundTripper
}

ErrorTransport defines the data structure for returning errors from the round tripper.

func (*ErrorTransport) RoundTrip

func (t *ErrorTransport) RoundTrip(request *http.Request) (*http.Response, error)

RoundTrip defines the round tripper for the error transport.

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 {
	Insecure bool
	Debug    bool
	SkipPing bool
	Timeout  time.Duration
}

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 retriving information from the registry API.

func New

func New(auth types.AuthConfig, opt Opt) (*Registry, error)

New creates a new Registry struct with the given URL and credentials.

func (*Registry) Catalog

func (r *Registry) Catalog(u string) ([]string, error)

Catalog returns the repositories in a registry.

func (*Registry) Delete

func (r *Registry) Delete(repository, digest string) error

Delete removes a repository digest or reference from the registry. https://docs.docker.com/registry/spec/api/#deleting-an-image

func (*Registry) Digest

func (r *Registry) Digest(repository, ref string) (string, error)

Digest returns the digest for a repository and reference.

func (*Registry) DownloadLayer

func (r *Registry) DownloadLayer(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(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

func (r *Registry) Headers(uri string) (map[string]string, error)

Headers returns the authorization headers for a specific uri.

func (*Registry) Manifest

func (r *Registry) Manifest(repository, ref string) (distribution.Manifest, error)

Manifest returns the manifest for a specific repository:tag.

func (*Registry) ManifestList

func (r *Registry) ManifestList(repository, ref string) (manifestlist.ManifestList, error)

ManifestList gets the registry v2 manifest list.

func (*Registry) ManifestV1

func (r *Registry) ManifestV1(repository, ref string) (schema1.SignedManifest, error)

ManifestV1 gets the registry v1 manifest.

func (*Registry) ManifestV2

func (r *Registry) ManifestV2(repository, ref string) (schema2.Manifest, error)

ManifestV2 gets the registry v2 manifest.

func (*Registry) Ping

func (r *Registry) Ping() error

Ping tries to contact a registry URL to make sure it is up and accessible.

func (*Registry) Tags

func (r *Registry) Tags(repository string) ([]string, error)

Tags returns the tags for a specific repository.

func (*Registry) Token

func (r *Registry) Token(url string) (string, error)

Token returns the required token for the specific resource url.

func (*Registry) UploadLayer

func (r *Registry) UploadLayer(repository string, digest reference.Reference, content io.Reader) error

UploadLayer uploads a specific layer by digest for a repository.

type TokenTransport

type TokenTransport struct {
	Transport http.RoundTripper
	Username  string
	Password  string
}

TokenTransport defines the data structure for authentication via tokens.

func (*TokenTransport) RoundTrip

func (t *TokenTransport) RoundTrip(req *http.Request) (*http.Response, error)

RoundTrip defines the round tripper for token transport.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL