Documentation ¶
Index ¶
- Constants
- func DirExists(d string) bool
- func NewImageStore(rootDir string, gc bool, gcDelay time.Duration, dedupe, commit bool, ...) storage.ImageStore
- func ValidateHardLink(rootDir string) error
- type ImageStoreLocal
- func (is *ImageStoreLocal) BlobPath(repo string, digest godigest.Digest) string
- func (is *ImageStoreLocal) BlobUploadInfo(repo, uuid string) (int64, error)
- func (is *ImageStoreLocal) BlobUploadPath(repo, uuid string) string
- func (is *ImageStoreLocal) CheckBlob(repo string, digest godigest.Digest) (bool, int64, error)
- func (is *ImageStoreLocal) DedupeBlob(src string, dstDigest godigest.Digest, dst string) error
- func (is *ImageStoreLocal) DeleteBlob(repo string, digest godigest.Digest) error
- func (is *ImageStoreLocal) DeleteBlobUpload(repo, uuid string) error
- func (is *ImageStoreLocal) DeleteImageManifest(repo, reference string, detectCollision bool) error
- func (is *ImageStoreLocal) DirExists(d string) bool
- func (is *ImageStoreLocal) FinishBlobUpload(repo, uuid string, body io.Reader, dstDigest godigest.Digest) error
- func (is *ImageStoreLocal) FullBlobUpload(repo string, body io.Reader, dstDigest godigest.Digest) (string, int64, error)
- func (is *ImageStoreLocal) GetBlob(repo string, digest godigest.Digest, mediaType string) (io.ReadCloser, int64, error)
- func (is *ImageStoreLocal) GetBlobContent(repo string, digest godigest.Digest) ([]byte, error)
- func (is *ImageStoreLocal) GetBlobPartial(repo string, digest godigest.Digest, mediaType string, from, to int64) (io.ReadCloser, int64, int64, error)
- func (is *ImageStoreLocal) GetBlobUpload(repo, uuid string) (int64, error)
- func (is *ImageStoreLocal) GetImageManifest(repo, reference string) ([]byte, godigest.Digest, string, error)
- func (is *ImageStoreLocal) GetImageTags(repo string) ([]string, error)
- func (is *ImageStoreLocal) GetIndexContent(repo string) ([]byte, error)
- func (is *ImageStoreLocal) GetNextRepository(repo string) (string, error)
- func (is *ImageStoreLocal) GetOrasReferrers(repo string, gdigest godigest.Digest, artifactType string) ([]oras.Descriptor, error)
- func (is *ImageStoreLocal) GetReferrers(repo string, gdigest godigest.Digest, artifactType string) (ispec.Index, error)
- func (is *ImageStoreLocal) GetRepositories() ([]string, error)
- func (is *ImageStoreLocal) InitRepo(name string) error
- func (is *ImageStoreLocal) Lock(lockStart *time.Time)
- func (is *ImageStoreLocal) NewBlobUpload(repo string) (string, error)
- func (is *ImageStoreLocal) PutBlobChunk(repo, uuid string, from, to int64, body io.Reader) (int64, error)
- func (is *ImageStoreLocal) PutBlobChunkStreamed(repo, uuid string, body io.Reader) (int64, error)
- func (is *ImageStoreLocal) PutImageManifest(repo, reference, mediaType string, body []byte) (godigest.Digest, error)
- func (is *ImageStoreLocal) RLock(lockStart *time.Time)
- func (is *ImageStoreLocal) RUnlock(lockStart *time.Time)
- func (is *ImageStoreLocal) RootDir() string
- func (is *ImageStoreLocal) RunGCPeriodically(interval time.Duration, sch *scheduler.Scheduler)
- func (is *ImageStoreLocal) RunGCRepo(repo string) error
- func (is *ImageStoreLocal) Unlock(lockStart *time.Time)
- func (is *ImageStoreLocal) ValidateRepo(name string) (bool, error)
Constants ¶
const ( DefaultFilePerms = 0o600 DefaultDirPerms = 0o700 )
Variables ¶
This section is empty.
Functions ¶
func NewImageStore ¶
func NewImageStore(rootDir string, gc bool, gcDelay time.Duration, dedupe, commit bool, log zlog.Logger, metrics monitoring.MetricServer, linter storage.Lint, cacheDriver cache.Cache, ) storage.ImageStore
NewImageStore returns a new image store backed by a file storage. Use the last argument to properly set a cache database, or it will default to boltDB local storage.
func ValidateHardLink ¶
Types ¶
type ImageStoreLocal ¶
type ImageStoreLocal struct {
// contains filtered or unexported fields
}
ImageStoreLocal provides the image storage operations.
func (*ImageStoreLocal) BlobPath ¶
func (is *ImageStoreLocal) BlobPath(repo string, digest godigest.Digest) string
BlobPath returns the repository path of a blob.
func (*ImageStoreLocal) BlobUploadInfo ¶
func (is *ImageStoreLocal) BlobUploadInfo(repo, uuid string) (int64, error)
BlobUploadInfo returns the current blob size in bytes.
func (*ImageStoreLocal) BlobUploadPath ¶
func (is *ImageStoreLocal) BlobUploadPath(repo, uuid string) string
BlobUploadPath returns the upload path for a blob in this store.
func (*ImageStoreLocal) CheckBlob ¶
CheckBlob verifies a blob and returns true if the blob is correct.
func (*ImageStoreLocal) DedupeBlob ¶
func (*ImageStoreLocal) DeleteBlob ¶
func (is *ImageStoreLocal) DeleteBlob(repo string, digest godigest.Digest) error
DeleteBlob removes the blob from the repository.
func (*ImageStoreLocal) DeleteBlobUpload ¶
func (is *ImageStoreLocal) DeleteBlobUpload(repo, uuid string) error
DeleteBlobUpload deletes an existing blob upload that is currently in progress.
func (*ImageStoreLocal) DeleteImageManifest ¶
func (is *ImageStoreLocal) DeleteImageManifest(repo, reference string, detectCollision bool) error
DeleteImageManifest deletes the image manifest from the repository.
func (*ImageStoreLocal) DirExists ¶
func (is *ImageStoreLocal) DirExists(d string) bool
func (*ImageStoreLocal) FinishBlobUpload ¶
func (is *ImageStoreLocal) FinishBlobUpload(repo, uuid string, body io.Reader, dstDigest godigest.Digest) error
FinishBlobUpload finalizes the blob upload and moves blob the repository.
func (*ImageStoreLocal) FullBlobUpload ¶
func (is *ImageStoreLocal) 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 (*ImageStoreLocal) GetBlob ¶
func (is *ImageStoreLocal) 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 (*ImageStoreLocal) GetBlobContent ¶
GetBlobContent returns blob contents, SHOULD lock from outside.
func (*ImageStoreLocal) GetBlobPartial ¶
func (is *ImageStoreLocal) 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 (*ImageStoreLocal) GetBlobUpload ¶
func (is *ImageStoreLocal) GetBlobUpload(repo, uuid string) (int64, error)
GetBlobUpload returns the current size of a blob upload.
func (*ImageStoreLocal) GetImageManifest ¶
func (is *ImageStoreLocal) GetImageManifest(repo, reference string) ([]byte, godigest.Digest, string, error)
GetImageManifest returns the image manifest of an image in the specific repository.
func (*ImageStoreLocal) GetImageTags ¶
func (is *ImageStoreLocal) GetImageTags(repo string) ([]string, error)
GetImageTags returns a list of image tags available in the specified repository.
func (*ImageStoreLocal) GetIndexContent ¶
func (is *ImageStoreLocal) GetIndexContent(repo string) ([]byte, error)
GetIndexContent returns index.json contents, SHOULD lock from outside.
func (*ImageStoreLocal) GetNextRepository ¶
func (is *ImageStoreLocal) GetNextRepository(repo string) (string, error)
GetNextRepository returns next repository under this store.
func (*ImageStoreLocal) GetOrasReferrers ¶
func (is *ImageStoreLocal) GetOrasReferrers(repo string, gdigest godigest.Digest, artifactType string, ) ([]oras.Descriptor, error)
func (*ImageStoreLocal) GetReferrers ¶
func (*ImageStoreLocal) GetRepositories ¶
func (is *ImageStoreLocal) GetRepositories() ([]string, error)
GetRepositories returns a list of all the repositories under this store.
func (*ImageStoreLocal) InitRepo ¶
func (is *ImageStoreLocal) InitRepo(name string) error
InitRepo creates an image repository under this store.
func (*ImageStoreLocal) Lock ¶
func (is *ImageStoreLocal) Lock(lockStart *time.Time)
Lock write-lock.
func (*ImageStoreLocal) NewBlobUpload ¶
func (is *ImageStoreLocal) NewBlobUpload(repo string) (string, error)
NewBlobUpload returns the unique ID for an upload in progress.
func (*ImageStoreLocal) PutBlobChunk ¶
func (is *ImageStoreLocal) 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 (*ImageStoreLocal) PutBlobChunkStreamed ¶
PutBlobChunkStreamed appends another chunk of data to the specified blob. It returns the number of actual bytes to the blob.
func (*ImageStoreLocal) PutImageManifest ¶
func (is *ImageStoreLocal) PutImageManifest(repo, reference, mediaType string, body []byte, ) (godigest.Digest, error)
PutImageManifest adds an image manifest to the repository.
func (*ImageStoreLocal) RLock ¶
func (is *ImageStoreLocal) RLock(lockStart *time.Time)
RLock read-lock.
func (*ImageStoreLocal) RUnlock ¶
func (is *ImageStoreLocal) RUnlock(lockStart *time.Time)
RUnlock read-unlock.
func (*ImageStoreLocal) RootDir ¶
func (is *ImageStoreLocal) RootDir() string
func (*ImageStoreLocal) RunGCPeriodically ¶
func (is *ImageStoreLocal) RunGCPeriodically(interval time.Duration, sch *scheduler.Scheduler)
func (*ImageStoreLocal) RunGCRepo ¶
func (is *ImageStoreLocal) RunGCRepo(repo string) error
func (*ImageStoreLocal) Unlock ¶
func (is *ImageStoreLocal) Unlock(lockStart *time.Time)
Unlock write-unlock.
func (*ImageStoreLocal) ValidateRepo ¶
func (is *ImageStoreLocal) ValidateRepo(name string) (bool, error)
ValidateRepo validates that the repository layout is complaint with the OCI repo layout.