s3

package
v1.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 9, 2022 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RLOCK       = "RLock"
	RWLOCK      = "RWLock"
	CacheDBName = "s3_cache"
)

Variables

This section is empty.

Functions

func NewImageStore

func NewImageStore(rootDir string, cacheDir string, gc bool, gcDelay time.Duration, 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, uuid string) (int64, error)

BlobUploadInfo returns the current blob size in bytes.

func (*ObjectStorage) BlobUploadPath

func (is *ObjectStorage) BlobUploadPath(repo, uuid string) string

BlobUploadPath returns the upload path for a blob in this store.

func (*ObjectStorage) CheckBlob

func (is *ObjectStorage) CheckBlob(repo, digest string) (bool, int64, error)

CheckBlob verifies a blob and returns true if the blob is correct.

func (*ObjectStorage) DedupeBlob

func (is *ObjectStorage) DedupeBlob(src string, dstDigest godigest.Digest, dst string) error

func (*ObjectStorage) DeleteBlob

func (is *ObjectStorage) DeleteBlob(repo, digest string) error

DeleteBlob removes the blob from the repository.

func (*ObjectStorage) DeleteBlobUpload

func (is *ObjectStorage) DeleteBlobUpload(repo, uuid string) error

DeleteBlobUpload deletes an existing blob upload that is currently in progress.

func (*ObjectStorage) DeleteImageManifest

func (is *ObjectStorage) DeleteImageManifest(repo, 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, 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, digest, 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, digest string) ([]byte, error)

func (*ObjectStorage) GetBlobUpload

func (is *ObjectStorage) GetBlobUpload(repo, uuid string) (int64, error)

GetBlobUpload returns the current size of a blob upload.

func (*ObjectStorage) GetImageManifest

func (is *ObjectStorage) GetImageManifest(repo, 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, 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) Lock

func (is *ObjectStorage) Lock(lockStart *time.Time)

Lock write-lock.

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, uuid string, from, 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, 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, reference, mediaType string,
	body []byte,
) (string, error)

PutImageManifest adds an image manifest to the repository.

func (*ObjectStorage) RLock

func (is *ObjectStorage) RLock(lockStart *time.Time)

RLock read-lock.

func (*ObjectStorage) RUnlock

func (is *ObjectStorage) RUnlock(lockStart *time.Time)

RUnlock read-unlock.

func (*ObjectStorage) RootDir

func (is *ObjectStorage) RootDir() string

func (*ObjectStorage) RunGCRepo added in v1.4.1

func (is *ObjectStorage) RunGCRepo(repo 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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL