s3

package
v1.4.3 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2022 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CacheDBName = "s3_cache"
)

Variables

This section is empty.

Functions

func NewBlobStream added in v1.4.2

func NewBlobStream(readCloser io.ReadCloser, from, to int64) (io.ReadCloser, error)

func NewImageStore

func NewImageStore(rootDir string, cacheDir string, gc bool, gcDelay time.Duration, dedupe, commit bool,
	log zlog.Logger, metrics monitoring.MetricServer, linter storage.Lint,
	store driver.StorageDriver, cacheDriver cache.Cache,
) 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 Use the last argument to properly set a cache database, or it will default to boltDB local storage.

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 string, digest godigest.Digest) (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 string, digest godigest.Digest) 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, detectCollisions bool) 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, dstDigest godigest.Digest) error

FinishBlobUpload finalizes the blob upload and moves blob the repository.

func (*ObjectStorage) FullBlobUpload

func (is *ObjectStorage) FullBlobUpload(repo string, body io.Reader, dstDigest godigest.Digest) (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 godigest.Digest, mediaType string) (io.ReadCloser, 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 godigest.Digest) ([]byte, error)

GetBlobContent returns blob contents, SHOULD lock from outside.

func (*ObjectStorage) GetBlobPartial added in v1.4.2

func (is *ObjectStorage) GetBlobPartial(repo string, digest godigest.Digest, mediaType string, from, to int64,
) (io.ReadCloser, int64, int64, error)

GetBlobPartial returns a partial stream to read the blob. blob selector instead of directly downloading the blob.

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, godigest.Digest, 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)

GetIndexContent returns index.json contents, SHOULD lock from outside.

func (*ObjectStorage) GetNextRepository added in v1.4.3

func (is *ObjectStorage) GetNextRepository(repo string) (string, error)

GetNextRepository returns next repository under this store.

func (*ObjectStorage) GetOrasReferrers added in v1.4.3

func (is *ObjectStorage) GetOrasReferrers(repo string, gdigest godigest.Digest, artifactType string,
) ([]artifactspec.Descriptor, error)

func (*ObjectStorage) GetReferrers

func (is *ObjectStorage) GetReferrers(repo string, gdigest godigest.Digest, artifactType string,
) (ispec.Index, 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,
) (godigest.Digest, 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) RunGCPeriodically added in v1.4.0

func (is *ObjectStorage) RunGCPeriodically(interval time.Duration, sch *scheduler.Scheduler)

func (*ObjectStorage) RunGCRepo added in v1.4.1

func (is *ObjectStorage) RunGCRepo(repo string) error

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