Documentation
¶
Index ¶
- func ManifestHandler(m []byte, t string) (manifest.Manifest, []*digest.Digest, error)
- func NewSyncBlobRecorder(onDisk string) error
- type ImageDestination
- 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(manifestByte []byte, manifestType string) ([]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 ManifestSchemaV2Info
- type ManifestSchemaV2List
- type SyncBlobRecorder
- func (slr *SyncBlobRecorder) Flush()
- func (slr *SyncBlobRecorder) GetRegistryRecords(registry string) map[string]int64
- func (slr *SyncBlobRecorder) LockRecorder()
- func (slr *SyncBlobRecorder) Query(registry, digest string) (int64, bool)
- func (slr *SyncBlobRecorder) Record(registry, digest string, size int64) error
- func (slr *SyncBlobRecorder) UnlockRecorder()
- func (slr *SyncBlobRecorder) UpdateRegistryRecords(registry string, recordList map[string]int64) error
- type SyncTask
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ManifestHandler ¶
Expend 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.
func NewSyncBlobRecorder ¶
Initialize a SyncBlobRecorder.
Types ¶
type ImageDestination ¶
type ImageDestination struct {
// contains filtered or unexported fields
}
A PushTask reference to a remote image we will push to
func NewImageDestination ¶
func NewImageDestination(registry, repository, tag, username, password string) (*ImageDestination, error)
Generate a PullTask by repository, the repository string must include "tag", if username or password is empty, access to repository will be anonymous.
func (*ImageDestination) Close ¶
func (i *ImageDestination) Close() error
func (*ImageDestination) GetRegistry ¶
func (i *ImageDestination) GetRegistry() string
func (*ImageDestination) GetRepository ¶
func (i *ImageDestination) GetRepository() string
func (*ImageDestination) GetTag ¶
func (i *ImageDestination) GetTag() string
func (*ImageDestination) PushManifest ¶
func (i *ImageDestination) PushManifest(manifestByte []byte) error
Push a manifest file to destinate image
func (*ImageDestination) PutABlob ¶
func (i *ImageDestination) PutABlob(blob io.ReadCloser, blobInfo types.BlobInfo) error
Push a blob to destinate image
type ImageSource ¶
type ImageSource struct {
// contains filtered or unexported fields
}
A ImageSource reference to a remote image need to be pulled.
func NewImageSource ¶
func NewImageSource(registry, repository, tag, username, password string) (*ImageSource, error)
Generate 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) Close ¶
func (i *ImageSource) Close() error
func (*ImageSource) GetABlob ¶
func (i *ImageSource) GetABlob(blobInfo types.BlobInfo) (io.ReadCloser, int64, error)
func (*ImageSource) GetBlobInfos ¶
func (i *ImageSource) GetBlobInfos(manifestByte []byte, manifestType string) ([]types.BlobInfo, error)
Get blobs from source image.
func (*ImageSource) GetManifest ¶
func (i *ImageSource) GetManifest() ([]byte, string, error)
Get manifest file from source image
func (*ImageSource) GetRegistry ¶
func (i *ImageSource) GetRegistry() string
func (*ImageSource) GetRepository ¶
func (i *ImageSource) GetRepository() string
func (*ImageSource) GetSourceRepoTags ¶
func (i *ImageSource) GetSourceRepoTags() ([]string, error)
func (*ImageSource) GetTag ¶
func (i *ImageSource) GetTag() string
type ManifestSchemaV2Info ¶
type ManifestSchemaV2Info struct {
Digest string `json:"digest"`
}
type ManifestSchemaV2List ¶
type ManifestSchemaV2List struct {
Manifests []ManifestSchemaV2Info `json:"manifests"`
}
type SyncBlobRecorder ¶
type SyncBlobRecorder struct { Blobs map[string](map[string]int64) // contains filtered or unexported fields }
var ( // a map record the synchronized layer for the same registry // the map is going to look something like: <registry>:<digest>:<size> SynchronizedBlobs *SyncBlobRecorder NoCache = none.NoCache )
func (*SyncBlobRecorder) Flush ¶
func (slr *SyncBlobRecorder) Flush()
func (*SyncBlobRecorder) GetRegistryRecords ¶
func (slr *SyncBlobRecorder) GetRegistryRecords(registry string) map[string]int64
func (*SyncBlobRecorder) LockRecorder ¶
func (slr *SyncBlobRecorder) LockRecorder()
func (*SyncBlobRecorder) Query ¶
func (slr *SyncBlobRecorder) Query(registry, digest string) (int64, bool)
Query the recorder if a layer has been synchronized
func (*SyncBlobRecorder) Record ¶
func (slr *SyncBlobRecorder) Record(registry, digest string, size int64) error
Record infomation of a layer that has been synchronized
func (*SyncBlobRecorder) UnlockRecorder ¶
func (slr *SyncBlobRecorder) UnlockRecorder()
func (*SyncBlobRecorder) UpdateRegistryRecords ¶
func (slr *SyncBlobRecorder) UpdateRegistryRecords(registry string, recordList map[string]int64) error
type SyncTask ¶
type SyncTask struct {
// contains filtered or unexported fields
}
SyncTask act as a sync action, it will pull a images from source to destination
func NewSyncTask ¶
func NewSyncTask(source *ImageSource, destination *ImageDestination, logger *logrus.Logger) *SyncTask