Documentation ¶
Index ¶
- Variables
- func ManifestHandler(m []byte, t string, i *ImageSource) ([]manifest.Manifest, error)
- type ImageSource
- func (i *ImageSource) Close() error
- func (i *ImageSource) GetABlob(blobInfo types.BlobInfo) (io.ReadCloser, int64, error)
- func (i *ImageSource) GetBlobInfos(manifestByte []byte, manifestType string) ([]types.BlobInfo, error)
- func (i *ImageSource) GetImageDigest() (digest.Digest, error)
- func (i *ImageSource) GetManifest() ([]byte, string, error)
- func (i *ImageSource) GetRegistry() string
- func (i *ImageSource) GetRepository() string
- func (i *ImageSource) GetSourceRepoTags() ([]string, error)
- func (i *ImageSource) GetTag() string
- type ImageTarget
- func (i *ImageTarget) CheckBlobExist(blobInfo types.BlobInfo) (bool, error)
- func (i *ImageTarget) Close() error
- func (i *ImageTarget) GetImageDigest() (digest.Digest, error)
- func (i *ImageTarget) GetRegistry() string
- func (i *ImageTarget) GetRepository() string
- func (i *ImageTarget) GetTag() string
- func (i *ImageTarget) GetTargetRepoTags() ([]string, error)
- func (i *ImageTarget) PushManifest(manifestByte []byte) error
- func (i *ImageTarget) PutABlob(blob io.ReadCloser, blobInfo types.BlobInfo) error
- type Job
- type ManifestSchemaV2Info
- type ManifestSchemaV2List
Constants ¶
This section is empty.
Variables ¶
var ( // NoCache used to disable a blobinfocache NoCache = none.NoCache // Memory cache to enable a blobinfocache Memory = memory.New() )
Functions ¶
func ManifestHandler ¶
ManifestHandler expends the ability of handling manifest list in schema2, but it's not finished yet return the digest array of manifests in the manifest list if exist.
Types ¶
type ImageSource ¶
type ImageSource struct {
// contains filtered or unexported fields
}
ImageSource is a reference to a remote image need to be pulled.
func NewImageSource ¶
func NewImageSource(registry, repository, tag, username, password string, insecure bool) (*ImageSource, error)
NewImageSource generates a PullJob by repository, the repository string must include "tag", if username or password is empty, access to repository will be anonymous. a repository string is the rest part of the images url except "tag" and "registry"
func (*ImageSource) GetABlob ¶
func (i *ImageSource) GetABlob(blobInfo types.BlobInfo) (io.ReadCloser, int64, error)
GetABlob gets a blob from remote image
func (*ImageSource) GetBlobInfos ¶
func (i *ImageSource) GetBlobInfos(manifestByte []byte, manifestType string) ([]types.BlobInfo, error)
GetBlobInfos get blobs from source image.
func (*ImageSource) GetImageDigest ¶ added in v1.2.0
func (i *ImageSource) GetImageDigest() (digest.Digest, error)
GetImageDigest checks if a tag exist for target, return target tag of digest
func (*ImageSource) GetManifest ¶
func (i *ImageSource) GetManifest() ([]byte, string, error)
GetManifest get manifest file from source image
func (*ImageSource) GetRegistry ¶
func (i *ImageSource) GetRegistry() string
GetRegistry returns the registry of a ImageSource
func (*ImageSource) GetRepository ¶
func (i *ImageSource) GetRepository() string
GetRepository returns the repository of a ImageSource
func (*ImageSource) GetSourceRepoTags ¶
func (i *ImageSource) GetSourceRepoTags() ([]string, error)
GetSourceRepoTags gets all the tags of a repository which ImageSource belongs to
func (*ImageSource) GetTag ¶
func (i *ImageSource) GetTag() string
GetTag returns the tag of a ImageSource
type ImageTarget ¶
type ImageTarget struct {
// contains filtered or unexported fields
}
ImageTarget is a reference of a remote image we will push to
func NewImageTarget ¶
func NewImageTarget(registry, repository, tag, username, password string, insecure bool) (*ImageTarget, error)
NewImageTarget generates a ImageTarget by repository, the repository string must include "tag". If username or password is empty, access to repository will be anonymous.
func (*ImageTarget) CheckBlobExist ¶
func (i *ImageTarget) CheckBlobExist(blobInfo types.BlobInfo) (bool, error)
CheckBlobExist checks if a blob exist for target and reuse exist blobs
func (*ImageTarget) GetImageDigest ¶ added in v1.2.0
func (i *ImageTarget) GetImageDigest() (digest.Digest, error)
GetImageDigest checks if a tag exist for target, return target tag of digest
func (*ImageTarget) GetRegistry ¶
func (i *ImageTarget) GetRegistry() string
GetRegistry returns the registry of a ImageTarget
func (*ImageTarget) GetRepository ¶
func (i *ImageTarget) GetRepository() string
GetRepository returns the repository of a ImageTarget
func (*ImageTarget) GetTag ¶
func (i *ImageTarget) GetTag() string
GetTag return the tag of a ImageTarget
func (*ImageTarget) GetTargetRepoTags ¶ added in v1.2.0
func (i *ImageTarget) GetTargetRepoTags() ([]string, error)
GetTargetRepoTags gets all the tags of a repository which ImageTarget belongs to
func (*ImageTarget) PushManifest ¶
func (i *ImageTarget) PushManifest(manifestByte []byte) error
PushManifest push a manifest file to target image
func (*ImageTarget) PutABlob ¶
func (i *ImageTarget) PutABlob(blob io.ReadCloser, blobInfo types.BlobInfo) error
PutABlob push a blob to target image
type Job ¶
type Job struct { Source *ImageSource Target *ImageTarget }
Job act as a sync action, it will pull a images from source to target
func NewJob ¶
func NewJob(source *ImageSource, target *ImageTarget) *Job
NewJob creates a transfer job
type ManifestSchemaV2Info ¶
type ManifestSchemaV2Info struct {
Digest string `json:"digest"`
}
ManifestSchemaV2Info includes of the imformation needes of a schema V2 manifest file
type ManifestSchemaV2List ¶
type ManifestSchemaV2List struct {
Manifests []ManifestSchemaV2Info `json:"manifests"`
}
ManifestSchemaV2List describes a schema V2 manifest list