registry

package
v5.0.0-preview.1+incom... Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2022 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrorNone uint = iota
	ErrorCertificate
	ErrorAuthentication
	ErrorUrl
	ErrorUnknown
)

Variables

View Source
var (
	ErrNoMorePages = errors.New("No more pages")
)

Functions

func WrapTransport

func WrapTransport(transport http.RoundTripper, url, username, password string) http.RoundTripper

* 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.

Types

type AuthorizationChallenge

type AuthorizationChallenge struct {
	Scheme     string
	Parameters map[string]string
}

AuthorizationChallenge carries information from a WWW-Authenticate response header.

type BasicTransport

type BasicTransport struct {
	Transport http.RoundTripper
	URL       string
	Username  string
	Password  string
}

func (*BasicTransport) RoundTrip

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

type ErrorTransport

type ErrorTransport struct {
	Transport http.RoundTripper
}

func (*ErrorTransport) RoundTrip

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

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 ManifestInfo

type ManifestInfo struct {
	SignedManifest *manifestV1.SignedManifest
	Digest         string
	RunAsRoot      bool
	Author         string
	Envs           []string
	Cmds           []string
	Labels         map[string]string
}

type Registry

type Registry struct {
	URL    string
	Client *httptrace.TraceClient
}

func NewInsecure

func NewInsecure(registryUrl, username, password, proxy string, trace httptrace.HTTPTrace) (*Registry, uint, error)

* Create a new Registry, as with New, using an http.Transport that disables * SSL certificate verification.

func NewSecure

func NewSecure(registryUrl, username, password, proxy string, trace httptrace.HTTPTrace) (*Registry, uint, error)

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

func (registry *Registry) DownloadLayer(ctx context.Context, repository string, digest digest.Digest) (io.ReadCloser, int64, error)

func (*Registry) HasLayer

func (registry *Registry) HasLayer(repository string, digest digest.Digest) (bool, error)

func (*Registry) LayerMetadata

func (registry *Registry) LayerMetadata(repository string, digest digest.Digest) (distribution.Descriptor, error)

func (*Registry) Manifest

func (r *Registry) Manifest(ctx context.Context, repository, reference string) (*ManifestInfo, error)

func (*Registry) ManifestRequest

func (r *Registry) ManifestRequest(ctx context.Context, repository, reference string, schema int) (string, []byte, error)

func (*Registry) ManifestV2

func (r *Registry) ManifestV2(ctx context.Context, repository, reference string) (*manifestV2.DeserializedManifest, string, error)

func (*Registry) Ping

func (r *Registry) Ping() (uint, error)

func (*Registry) Repositories

func (registry *Registry) Repositories() ([]string, error)

func (*Registry) Search

func (registry *Registry) Search(term string, limit int) ([]string, error)

func (*Registry) Tags

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

func (*Registry) UploadLayer

func (registry *Registry) UploadLayer(repository string, digest digest.Digest, content io.Reader) error

type TokenTransport

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

func (*TokenTransport) RoundTrip

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

Jump to

Keyboard shortcuts

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