Documentation ¶
Index ¶
- Constants
- func NewImageStore(rootDir string, gc, dedupe, commit bool, log zlog.Logger, ...) storage.ImageStore
- type ObjectStorage
- func (is *ObjectStorage) BlobPath(repo string, digest godigest.Digest) string
- func (is *ObjectStorage) BlobUploadInfo(repo string, uuid string) (int64, error)
- func (is *ObjectStorage) BlobUploadPath(repo string, uuid string) string
- func (is *ObjectStorage) CheckBlob(repo string, digest string) (bool, int64, error)
- func (is *ObjectStorage) DedupeBlob(src string, dstDigest godigest.Digest, dst string) error
- func (is *ObjectStorage) DeleteBlob(repo string, digest string) error
- func (is *ObjectStorage) DeleteBlobUpload(repo string, uuid string) error
- func (is *ObjectStorage) DeleteImageManifest(repo string, reference string) error
- func (is *ObjectStorage) DirExists(d string) bool
- func (is *ObjectStorage) FinishBlobUpload(repo string, uuid string, body io.Reader, digest string) error
- func (is *ObjectStorage) FullBlobUpload(repo string, body io.Reader, digest string) (string, int64, error)
- func (is *ObjectStorage) GetBlob(repo string, digest string, mediaType string) (io.Reader, int64, error)
- func (is *ObjectStorage) GetBlobContent(repo string, digest string) ([]byte, error)
- func (is *ObjectStorage) GetBlobUpload(repo string, uuid string) (int64, error)
- func (is *ObjectStorage) GetImageManifest(repo string, reference string) ([]byte, string, string, error)
- func (is *ObjectStorage) GetImageTags(repo string) ([]string, error)
- func (is *ObjectStorage) GetIndexContent(repo string) ([]byte, error)
- func (is *ObjectStorage) GetReferrers(repo, digest string, mediaType string) ([]artifactspec.Descriptor, error)
- func (is *ObjectStorage) GetRepositories() ([]string, error)
- func (is *ObjectStorage) InitRepo(name string) error
- func (is *ObjectStorage) Lock(lockStart *time.Time)
- func (is *ObjectStorage) NewBlobUpload(repo string) (string, error)
- func (is *ObjectStorage) PutBlobChunk(repo string, uuid string, from int64, to int64, body io.Reader) (int64, error)
- func (is *ObjectStorage) PutBlobChunkStreamed(repo string, uuid string, body io.Reader) (int64, error)
- func (is *ObjectStorage) PutImageManifest(repo string, reference string, mediaType string, body []byte) (string, error)
- func (is *ObjectStorage) RLock(lockStart *time.Time)
- func (is *ObjectStorage) RUnlock(lockStart *time.Time)
- func (is *ObjectStorage) RootDir() string
- func (is *ObjectStorage) Unlock(lockStart *time.Time)
- func (is *ObjectStorage) ValidateRepo(name string) (bool, error)
Constants ¶
const ( RLOCK = "RLock" RWLOCK = "RWLock" )
Variables ¶
This section is empty.
Functions ¶
func NewImageStore ¶
func NewImageStore(rootDir string, gc, dedupe, commit bool, log zlog.Logger, metrics monitoring.MetricServer, store driver.StorageDriver) storage.ImageStore
NewObjectStorage returns a new image store backed by cloud storages. see https://github.com/docker/docker.github.io/tree/master/registry/storage-drivers
Types ¶
type ObjectStorage ¶
type ObjectStorage struct {
// contains filtered or unexported fields
}
ObjectStorage provides the image storage operations.
func (*ObjectStorage) BlobPath ¶
func (is *ObjectStorage) BlobPath(repo string, digest godigest.Digest) string
BlobPath returns the repository path of a blob.
func (*ObjectStorage) BlobUploadInfo ¶
func (is *ObjectStorage) BlobUploadInfo(repo string, uuid string) (int64, error)
BlobUploadInfo returns the current blob size in bytes.
func (*ObjectStorage) BlobUploadPath ¶
func (is *ObjectStorage) BlobUploadPath(repo string, uuid string) string
BlobUploadPath returns the upload path for a blob in this store.
func (*ObjectStorage) CheckBlob ¶
CheckBlob verifies a blob and returns true if the blob is correct.
func (*ObjectStorage) DedupeBlob ¶
func (*ObjectStorage) DeleteBlob ¶
func (is *ObjectStorage) DeleteBlob(repo string, digest string) error
DeleteBlob removes the blob from the repository.
func (*ObjectStorage) DeleteBlobUpload ¶
func (is *ObjectStorage) DeleteBlobUpload(repo string, uuid string) error
DeleteBlobUpload deletes an existing blob upload that is currently in progress.
func (*ObjectStorage) DeleteImageManifest ¶
func (is *ObjectStorage) DeleteImageManifest(repo string, reference string) error
DeleteImageManifest deletes the image manifest from the repository.
func (*ObjectStorage) DirExists ¶
func (is *ObjectStorage) DirExists(d string) bool
func (*ObjectStorage) FinishBlobUpload ¶
func (is *ObjectStorage) FinishBlobUpload(repo string, uuid string, body io.Reader, digest string) error
FinishBlobUpload finalizes the blob upload and moves blob the repository.
func (*ObjectStorage) FullBlobUpload ¶
func (is *ObjectStorage) FullBlobUpload(repo string, body io.Reader, digest string) (string, int64, error)
FullBlobUpload handles a full blob upload, and no partial session is created.
func (*ObjectStorage) GetBlob ¶
func (is *ObjectStorage) GetBlob(repo string, digest string, mediaType string) (io.Reader, int64, error)
GetBlob returns a stream to read the blob. blob selector instead of directly downloading the blob.
func (*ObjectStorage) GetBlobContent ¶
func (is *ObjectStorage) GetBlobContent(repo string, digest string) ([]byte, error)
func (*ObjectStorage) GetBlobUpload ¶
func (is *ObjectStorage) GetBlobUpload(repo string, uuid string) (int64, error)
GetBlobUpload returns the current size of a blob upload.
func (*ObjectStorage) GetImageManifest ¶
func (is *ObjectStorage) GetImageManifest(repo string, reference string) ([]byte, string, string, error)
GetImageManifest returns the image manifest of an image in the specific repository.
func (*ObjectStorage) GetImageTags ¶
func (is *ObjectStorage) GetImageTags(repo string) ([]string, error)
GetImageTags returns a list of image tags available in the specified repository.
func (*ObjectStorage) GetIndexContent ¶
func (is *ObjectStorage) GetIndexContent(repo string) ([]byte, error)
func (*ObjectStorage) GetReferrers ¶
func (is *ObjectStorage) GetReferrers(repo, digest string, mediaType string) ([]artifactspec.Descriptor, error)
func (*ObjectStorage) GetRepositories ¶
func (is *ObjectStorage) GetRepositories() ([]string, error)
GetRepositories returns a list of all the repositories under this store.
func (*ObjectStorage) InitRepo ¶
func (is *ObjectStorage) InitRepo(name string) error
InitRepo creates an image repository under this store.
func (*ObjectStorage) NewBlobUpload ¶
func (is *ObjectStorage) NewBlobUpload(repo string) (string, error)
NewBlobUpload returns the unique ID for an upload in progress.
func (*ObjectStorage) PutBlobChunk ¶
func (is *ObjectStorage) PutBlobChunk(repo string, uuid string, from int64, to int64, body io.Reader) (int64, error)
PutBlobChunk writes another chunk of data to the specified blob. It returns the number of actual bytes to the blob.
func (*ObjectStorage) PutBlobChunkStreamed ¶
func (is *ObjectStorage) PutBlobChunkStreamed(repo string, uuid string, body io.Reader) (int64, error)
PutBlobChunkStreamed appends another chunk of data to the specified blob. It returns the number of actual bytes to the blob.
func (*ObjectStorage) PutImageManifest ¶
func (is *ObjectStorage) PutImageManifest(repo string, reference string, mediaType string, body []byte) (string, error)
PutImageManifest adds an image manifest to the repository.
func (*ObjectStorage) RUnlock ¶
func (is *ObjectStorage) RUnlock(lockStart *time.Time)
RUnlock read-unlock.
func (*ObjectStorage) RootDir ¶
func (is *ObjectStorage) RootDir() string
func (*ObjectStorage) Unlock ¶
func (is *ObjectStorage) Unlock(lockStart *time.Time)
Unlock write-unlock.
func (*ObjectStorage) ValidateRepo ¶
func (is *ObjectStorage) ValidateRepo(name string) (bool, error)
ValidateRepo validates that the repository layout is complaint with the OCI repo layout.