Documentation ¶
Index ¶
- Constants
- Variables
- func ManifestHandler(manifestBytes []byte, manifestType string, ...) ([]manifest.Manifest, interface{}, error)
- type ImageDestination
- func (i *ImageDestination) CheckBlobExist(blobInfo types.BlobInfo) (bool, error)
- func (i *ImageDestination) Close() error
- func (i *ImageDestination) GetRegistry() string
- func (i *ImageDestination) GetRepository() string
- func (i *ImageDestination) GetTag() string
- func (i *ImageDestination) PushManifest(manifestByte []byte) error
- func (i *ImageDestination) PutABlob(blob io.ReadCloser, blobInfo types.BlobInfo) error
- type ImageSource
- func (i *ImageSource) Close() error
- func (i *ImageSource) GetABlob(blobInfo types.BlobInfo) (io.ReadCloser, int64, error)
- func (i *ImageSource) GetBlobInfos(manifestInfoSlice []manifest.Manifest) ([]types.BlobInfo, 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 Task
Constants ¶
const Oauth2User = "_oauth2_"
Variables ¶
var ( // NoCache used to disable a blobinfocache NoCache = none.NoCache )
Functions ¶
func ManifestHandler ¶
func ManifestHandler(manifestBytes []byte, manifestType string, osFilterList, archFilterList []string, i *ImageSource, parent *manifest.Schema2List) ([]manifest.Manifest, interface{}, error)
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 ImageDestination ¶
type ImageDestination struct {
// contains filtered or unexported fields
}
ImageDestination is a reference of a remote image we will push to
func NewImageDestination ¶
func NewImageDestination(registry, repository, tag, username, password string, insecure bool) (*ImageDestination, error)
NewImageDestination generates a ImageDestination by repository, the repository string must include "tag". If username or password is empty, access to repository will be anonymous.
func (*ImageDestination) CheckBlobExist ¶ added in v1.3.3
func (i *ImageDestination) CheckBlobExist(blobInfo types.BlobInfo) (bool, error)
CheckBlobExist checks if a blob exist for destination and reuse exist blobs
func (*ImageDestination) GetRegistry ¶
func (i *ImageDestination) GetRegistry() string
GetRegistry returns the registry of a ImageDestination
func (*ImageDestination) GetRepository ¶
func (i *ImageDestination) GetRepository() string
GetRepository returns the repository of a ImageDestination
func (*ImageDestination) GetTag ¶
func (i *ImageDestination) GetTag() string
GetTag return the tag of a ImageDestination
func (*ImageDestination) PushManifest ¶
func (i *ImageDestination) PushManifest(manifestByte []byte) error
PushManifest push a manifest file to destination image
func (*ImageDestination) PutABlob ¶
func (i *ImageDestination) PutABlob(blob io.ReadCloser, blobInfo types.BlobInfo) error
PutABlob push a blob to destination image
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 PullTask 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 ¶
GetBlobInfos get blobs from source image.
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 Task ¶ added in v1.0.3
type Task struct {
// contains filtered or unexported fields
}
Task act as a sync action, it will pull a images from source to destination
func NewTask ¶ added in v1.0.3
func NewTask(source *ImageSource, destination *ImageDestination, osFilterList, archFilterList []string, logger *logrus.Logger) *Task
NewTask creates a sync task