registry

package
v0.0.0-...-c8b2692 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2017 License: BSD-3-Clause Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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 Quiet

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

* Discard log messages silently.

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 Descriptor

type Descriptor struct {
	// MediaType describe the type of the content. All text based formats are
	// encoded as utf-8.
	MediaType string `json:"mediaType,omitempty"`

	// Size in bytes of content.
	Size int64 `json:"size,omitempty"`

	// Digest uniquely identifies the content. A byte stream can be verified
	// against against this digest.
	Digest digest.Digest `json:"digest,omitempty"`

	// URLs contains the source URLs of this content.
	URLs []string `json:"urls,omitempty"`
}

Descriptor describes targeted content. Used in conjunction with a blob store, a descriptor can be used to fetch, store and target any kind of blob. The struct also describes the wire protocol format. Fields should only be added but never changed.

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 LogfCallback

type LogfCallback func(format string, args ...interface{})

type Registry

type Registry struct {
	URL    string
	Client *http.Client
	Logf   LogfCallback
}

func New

func New(registryUrl, username, password string) (*Registry, 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 NewInsecure

func NewInsecure(registryUrl, username, password string) (*Registry, error)

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

func (*Registry) DeleteManifest

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

func (*Registry) DownloadLayer

func (registry *Registry) DownloadLayer(repository string, digest digest.Digest) (io.ReadCloser, 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) (Descriptor, error)

func (*Registry) Manifest

func (registry *Registry) Manifest(repository, reference string) (*manifestV1.SignedManifest, error)

func (*Registry) ManifestDigest

func (registry *Registry) ManifestDigest(repository, reference string) (digest.Digest, error)

func (*Registry) ManifestV2

func (registry *Registry) ManifestV2(repository, reference string) (*manifestV2.DeserializedManifest, error)

func (*Registry) Ping

func (r *Registry) Ping() error

func (*Registry) PutManifest

func (registry *Registry) PutManifest(repository, reference string, signedManifest *manifestV1.SignedManifest) error

func (*Registry) Repositories

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

func (*Registry) Tags

func (registry *Registry) Tags(repository string) (tags []string, err 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