Documentation ¶
Index ¶
- func NewV2Repository(ctx context.Context, repoInfo *registry.RepositoryInfo, ...) (repo distribution.Repository, foundVersion bool, err error)
- func Pull(ctx context.Context, ref reference.Named, imagePullConfig *ImagePullConfig) error
- func Push(ctx context.Context, ref reference.Named, imagePushConfig *ImagePushConfig) error
- func TranslatePullError(err error, ref reference.Named) error
- func ValidateRepoName(name string) error
- type ErrNoSupport
- type ImageConfigPullError
- type ImagePullConfig
- type ImagePushConfig
- type Puller
- type PushResult
- type Pusher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewV2Repository ¶
func NewV2Repository(ctx context.Context, repoInfo *registry.RepositoryInfo, endpoint registry.APIEndpoint, metaHeaders http.Header, authConfig *types.AuthConfig, actions ...string) (repo distribution.Repository, foundVersion bool, err error)
NewV2Repository returns a repository (v2 only). It creates an HTTP transport providing timeout settings and authentication support, and also verifies the remote API version.
func Pull ¶
Pull initiates a pull operation. image is the repository name to pull, and tag may be either empty, or indicate a specific tag to pull.
func Push ¶
Push initiates a push operation on ref. ref is the specific variant of the image to be pushed. If no tag is provided, all tags will be pushed.
func TranslatePullError ¶
TranslatePullError is used to convert an error from a registry pull operation to an error representing the entire pull operation. Any error information which is not used by the returned error gets output to log at info level.
func ValidateRepoName ¶
ValidateRepoName validates the name of a repository.
Types ¶
type ErrNoSupport ¶
type ErrNoSupport struct{ Err error }
ErrNoSupport is an error type used for errors indicating that an operation is not supported. It encapsulates a more specific error.
func (ErrNoSupport) Error ¶
func (e ErrNoSupport) Error() string
type ImageConfigPullError ¶
type ImageConfigPullError struct {
Err error
}
ImageConfigPullError is an error pulling the image config blob (only applies to schema2).
func (ImageConfigPullError) Error ¶
func (e ImageConfigPullError) Error() string
Error returns the error string for ImageConfigPullError.
type ImagePullConfig ¶
type ImagePullConfig struct { // MetaHeaders stores HTTP headers with metadata about the image MetaHeaders map[string][]string // AuthConfig holds authentication credentials for authenticating with // the registry. AuthConfig *types.AuthConfig // ProgressOutput is the interface for showing the status of the pull // operation. ProgressOutput progress.Output // RegistryService is the registry service to use for TLS configuration // and endpoint lookup. RegistryService registry.Service // ImageEventLogger notifies events for a given image ImageEventLogger func(id, name, action string) // MetadataStore is the storage backend for distribution-specific // metadata. MetadataStore metadata.Store // ImageStore manages images. ImageStore image.Store // ReferenceStore manages tags. ReferenceStore reference.Store // DownloadManager manages concurrent pulls. DownloadManager *xfer.LayerDownloadManager }
ImagePullConfig stores pull configuration.
type ImagePushConfig ¶
type ImagePushConfig struct { // MetaHeaders store HTTP headers with metadata about the image MetaHeaders map[string][]string // AuthConfig holds authentication credentials for authenticating with // the registry. AuthConfig *types.AuthConfig // ProgressOutput is the interface for showing the status of the push // operation. ProgressOutput progress.Output // RegistryService is the registry service to use for TLS configuration // and endpoint lookup. RegistryService registry.Service // ImageEventLogger notifies events for a given image ImageEventLogger func(id, name, action string) // MetadataStore is the storage backend for distribution-specific // metadata. MetadataStore metadata.Store // LayerStore manages layers. LayerStore layer.Store // ImageStore manages images. ImageStore image.Store // ReferenceStore manages tags. ReferenceStore reference.Store // TrustKey is the private key for legacy signatures. This is typically // an ephemeral key, since these signatures are no longer verified. TrustKey libtrust.PrivateKey // UploadManager dispatches uploads. UploadManager *xfer.LayerUploadManager }
ImagePushConfig stores push configuration.
type Puller ¶
type Puller interface { // Pull tries to pull the image referenced by `tag` // Pull returns an error if any, as well as a boolean that determines whether to retry Pull on the next configured endpoint. // Pull(ctx context.Context, ref reference.Named) error }
Puller is an interface that abstracts pulling for different API versions.
type PushResult ¶
PushResult contains the tag, manifest digest, and manifest size from the push. It's used to signal this information to the trust code in the client so it can sign the manifest if necessary.
type Pusher ¶
type Pusher interface { // Push tries to push the image configured at the creation of Pusher. // Push returns an error if any, as well as a boolean that determines whether to retry Push on the next configured endpoint. // // TODO(tiborvass): have Push() take a reference to repository + tag, so that the pusher itself is repository-agnostic. Push(ctx context.Context) error }
Pusher is an interface that abstracts pushing for different API versions.
func NewPusher ¶
func NewPusher(ref reference.Named, endpoint registry.APIEndpoint, repoInfo *registry.RepositoryInfo, imagePushConfig *ImagePushConfig) (Pusher, error)
NewPusher creates a new Pusher interface that will push to either a v1 or v2 registry. The endpoint argument contains a Version field that determines whether a v1 or v2 pusher will be created. The other parameters are passed through to the underlying pusher implementation for use during the actual push operation.