remote

package
v0.0.0-...-ec4d356 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2018 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package remote provides facilities for reading/writing v1.Images from/to a remote image registry.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckError

func CheckError(resp *http.Response, codes ...int) error

func Delete

Delete removes the specified image reference from the remote registry.

func Image

func Image(ref name.Reference, options ...ImageOption) (v1.Image, error)

Image provides access to a remote image reference, applying functional options to the underlying imageOpener before resolving the reference into a v1.Image.

func List

TODO(jonjohnsonjr): return []name.Tag?

func Write

func Write(ref name.Reference, img v1.Image, auth authn.Authenticator, t http.RoundTripper) error

Write pushes the provided img to the specified image reference.

Types

type Diagnostic

type Diagnostic struct {
	Code    ErrorCode   `json:"code"`
	Message string      `json:"message,omitempty"`
	Detail  interface{} `json:"detail,omitempty"`
}

Diagnostic represents a single error returned by a Docker registry interaction.

func (Diagnostic) String

func (d Diagnostic) String() string

String stringifies the Diagnostic

type Error

type Error struct {
	Errors []Diagnostic `json:"errors,omitempty"`
}

Error implements error to support the following error specification: https://github.com/docker/distribution/blob/master/docs/spec/api.md#errors

func (*Error) Error

func (e *Error) Error() string

Error implements error

type ErrorCode

type ErrorCode string

ErrorCode is an enumeration of supported error codes.

const (
	BlobUnknownErrorCode         ErrorCode = "BLOB_UNKNOWN"
	BlobUploadInvalidErrorCode   ErrorCode = "BLOB_UPLOAD_INVALID"
	BlobUploadUnknownErrorCode   ErrorCode = "BLOB_UPLOAD_UNKNOWN"
	DigestInvalidErrorCode       ErrorCode = "DIGEST_INVALID"
	ManifestBlobUnknownErrorCode ErrorCode = "MANIFEST_BLOB_UNKNOWN"
	ManifestInvalidErrorCode     ErrorCode = "MANIFEST_INVALID"
	ManifestUnknownErrorCode     ErrorCode = "MANIFEST_UNKNOWN"
	ManifestUnverifiedErrorCode  ErrorCode = "MANIFEST_UNVERIFIED"
	NameInvalidErrorCode         ErrorCode = "NAME_INVALID"
	NameUnknownErrorCode         ErrorCode = "NAME_UNKNOWN"
	SizeInvalidErrorCode         ErrorCode = "SIZE_INVALID"
	TagInvalidErrorCode          ErrorCode = "TAG_INVALID"
	UnauthorizedErrorCode        ErrorCode = "UNAUTHORIZED"
	DeniedErrorCode              ErrorCode = "DENIED"
	UnsupportedErrorCode         ErrorCode = "UNSUPPORTED"
)

The set of error conditions a registry may return: https://github.com/docker/distribution/blob/master/docs/spec/api.md#errors-2

type ImageOption

type ImageOption func(*imageOpener) error

func WithAuth

func WithAuth(auth authn.Authenticator) ImageOption

WithAuth is a functional option for overriding the default authenticator on a remote image

func WithAuthFromKeychain

func WithAuthFromKeychain(keys authn.Keychain) ImageOption

WithAuthFromKeychain is a functional option for overriding the default authenticator on a remote image using an authn.Keychain

func WithTransport

func WithTransport(t http.RoundTripper) ImageOption

WithTransport is a functional option for overriding the default transport on a remote image

type MountableLayer

type MountableLayer struct {
	v1.Layer

	Reference name.Reference
}

MountableLayer wraps a v1.Layer in a shim that enables the layer to be "mounted" when published to another registry.

type Tags

type Tags struct {
	Name string   `json:"name"`
	Tags []string `json:"tags"`
}

Directories

Path Synopsis
Package transport provides facilities for setting up an authenticated http.RoundTripper given an Authenticator and base RoundTripper.
Package transport provides facilities for setting up an authenticated http.RoundTripper given an Authenticator and base RoundTripper.

Jump to

Keyboard shortcuts

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