Documentation
¶
Index ¶
- Constants
- func DirExists(d string) bool
- func IsSupportedMediaType(mediaType string) bool
- func ValidateHardLink(rootDir string) error
- type Blob
- type BlobUpload
- type Cache
- type ImageStore
- type ImageStoreFS
- func (is *ImageStoreFS) BlobPath(repo string, digest godigest.Digest) string
- func (is *ImageStoreFS) BlobUploadInfo(repo, uuid string) (int64, error)
- func (is *ImageStoreFS) BlobUploadPath(repo, uuid string) string
- func (is *ImageStoreFS) CheckBlob(repo, digest string) (bool, int64, error)
- func (is *ImageStoreFS) DedupeBlob(src string, dstDigest godigest.Digest, dst string) error
- func (is *ImageStoreFS) DeleteBlob(repo, digest string) error
- func (is *ImageStoreFS) DeleteBlobUpload(repo, uuid string) error
- func (is *ImageStoreFS) DeleteImageManifest(repo, reference string) error
- func (is *ImageStoreFS) DirExists(d string) bool
- func (is *ImageStoreFS) FinishBlobUpload(repo, uuid string, body io.Reader, digest string) error
- func (is *ImageStoreFS) FullBlobUpload(repo string, body io.Reader, digest string) (string, int64, error)
- func (is *ImageStoreFS) GetBlob(repo, digest, mediaType string) (io.Reader, int64, error)
- func (is *ImageStoreFS) GetBlobContent(repo, digest string) ([]byte, error)
- func (is *ImageStoreFS) GetBlobUpload(repo, uuid string) (int64, error)
- func (is *ImageStoreFS) GetImageManifest(repo, reference string) ([]byte, string, string, error)
- func (is *ImageStoreFS) GetImageTags(repo string) ([]string, error)
- func (is *ImageStoreFS) GetIndexContent(repo string) ([]byte, error)
- func (is *ImageStoreFS) GetReferrers(repo, digest, mediaType string) ([]artifactspec.Descriptor, error)
- func (is *ImageStoreFS) GetRepositories() ([]string, error)
- func (is *ImageStoreFS) InitRepo(name string) error
- func (is *ImageStoreFS) Lock(lockStart *time.Time)
- func (is *ImageStoreFS) NewBlobUpload(repo string) (string, error)
- func (is *ImageStoreFS) PutBlobChunk(repo, uuid string, from, to int64, body io.Reader) (int64, error)
- func (is *ImageStoreFS) PutBlobChunkStreamed(repo, uuid string, body io.Reader) (int64, error)
- func (is *ImageStoreFS) PutImageManifest(repo, reference, mediaType string, body []byte) (string, error)
- func (is *ImageStoreFS) RLock(lockStart *time.Time)
- func (is *ImageStoreFS) RUnlock(lockStart *time.Time)
- func (is *ImageStoreFS) RootDir() string
- func (is *ImageStoreFS) RunGCRepo(repo string)
- func (is *ImageStoreFS) Unlock(lockStart *time.Time)
- func (is *ImageStoreFS) ValidateRepo(name string) (bool, error)
- type ScrubImageResult
- type ScrubResults
- type StoreController
Constants ¶
const ( BlobsCache = "blobs" DBExtensionName = ".db" )
const ( S3StorageDriverName = "s3" DefaultGCDelay = 1 * time.Hour )
const ( // BlobUploadDir defines the upload directory for blob uploads. BlobUploadDir = ".uploads" SchemaVersion = 2 DefaultFilePerms = 0o600 DefaultDirPerms = 0o700 RLOCK = "RLock" RWLOCK = "RWLock" )
Variables ¶
This section is empty.
Functions ¶
func IsSupportedMediaType ¶
func ValidateHardLink ¶
Types ¶
type BlobUpload ¶
BlobUpload models and upload request.
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
func (*Cache) DeleteBlob ¶
type ImageStore ¶
type ImageStore interface { DirExists(d string) bool RootDir() string RLock(*time.Time) RUnlock(*time.Time) Lock(*time.Time) Unlock(*time.Time) InitRepo(name string) error ValidateRepo(name string) (bool, error) GetRepositories() ([]string, error) GetImageTags(repo string) ([]string, error) GetImageManifest(repo, reference string) ([]byte, string, string, error) PutImageManifest(repo, reference, mediaType string, body []byte) (string, error) DeleteImageManifest(repo, reference string) error BlobUploadPath(repo, uuid string) string NewBlobUpload(repo string) (string, error) GetBlobUpload(repo, uuid string) (int64, error) PutBlobChunkStreamed(repo, uuid string, body io.Reader) (int64, error) PutBlobChunk(repo, uuid string, from, to int64, body io.Reader) (int64, error) BlobUploadInfo(repo, uuid string) (int64, error) FinishBlobUpload(repo, uuid string, body io.Reader, digest string) error FullBlobUpload(repo string, body io.Reader, digest string) (string, int64, error) DedupeBlob(src string, dstDigest digest.Digest, dst string) error DeleteBlobUpload(repo, uuid string) error BlobPath(repo string, digest digest.Digest) string CheckBlob(repo, digest string) (bool, int64, error) GetBlob(repo, digest, mediaType string) (io.Reader, int64, error) DeleteBlob(repo, digest string) error GetIndexContent(repo string) ([]byte, error) GetBlobContent(repo, digest string) ([]byte, error) GetReferrers(repo, digest string, mediaType string) ([]artifactspec.Descriptor, error) RunGCRepo(repo string) }
func NewImageStore ¶
func NewImageStore(rootDir string, gc bool, gcDelay time.Duration, dedupe, commit bool, log zlog.Logger, metrics monitoring.MetricServer, ) ImageStore
NewImageStore returns a new image store backed by a file storage.
type ImageStoreFS ¶
type ImageStoreFS struct {
// contains filtered or unexported fields
}
ImageStoreFS provides the image storage operations.
func (*ImageStoreFS) BlobPath ¶
func (is *ImageStoreFS) BlobPath(repo string, digest godigest.Digest) string
BlobPath returns the repository path of a blob.
func (*ImageStoreFS) BlobUploadInfo ¶
func (is *ImageStoreFS) BlobUploadInfo(repo, uuid string) (int64, error)
BlobUploadInfo returns the current blob size in bytes.
func (*ImageStoreFS) BlobUploadPath ¶
func (is *ImageStoreFS) BlobUploadPath(repo, uuid string) string
BlobUploadPath returns the upload path for a blob in this store.
func (*ImageStoreFS) CheckBlob ¶
func (is *ImageStoreFS) CheckBlob(repo, digest string) (bool, int64, error)
CheckBlob verifies a blob and returns true if the blob is correct.
func (*ImageStoreFS) DedupeBlob ¶
func (*ImageStoreFS) DeleteBlob ¶
func (is *ImageStoreFS) DeleteBlob(repo, digest string) error
DeleteBlob removes the blob from the repository.
func (*ImageStoreFS) DeleteBlobUpload ¶
func (is *ImageStoreFS) DeleteBlobUpload(repo, uuid string) error
DeleteBlobUpload deletes an existing blob upload that is currently in progress.
func (*ImageStoreFS) DeleteImageManifest ¶
func (is *ImageStoreFS) DeleteImageManifest(repo, reference string) error
DeleteImageManifest deletes the image manifest from the repository.
func (*ImageStoreFS) DirExists ¶
func (is *ImageStoreFS) DirExists(d string) bool
func (*ImageStoreFS) FinishBlobUpload ¶
FinishBlobUpload finalizes the blob upload and moves blob the repository.
func (*ImageStoreFS) FullBlobUpload ¶
func (is *ImageStoreFS) FullBlobUpload(repo string, body io.Reader, digest string) (string, int64, error)
FullBlobUpload handles a full blob upload, and no partial session is created.
func (*ImageStoreFS) GetBlob ¶
GetBlob returns a stream to read the blob. blob selector instead of directly downloading the blob.
func (*ImageStoreFS) GetBlobContent ¶
func (is *ImageStoreFS) GetBlobContent(repo, digest string) ([]byte, error)
func (*ImageStoreFS) GetBlobUpload ¶
func (is *ImageStoreFS) GetBlobUpload(repo, uuid string) (int64, error)
GetBlobUpload returns the current size of a blob upload.
func (*ImageStoreFS) GetImageManifest ¶
GetImageManifest returns the image manifest of an image in the specific repository.
func (*ImageStoreFS) GetImageTags ¶
func (is *ImageStoreFS) GetImageTags(repo string) ([]string, error)
GetImageTags returns a list of image tags available in the specified repository.
func (*ImageStoreFS) GetIndexContent ¶
func (is *ImageStoreFS) GetIndexContent(repo string) ([]byte, error)
func (*ImageStoreFS) GetReferrers ¶
func (is *ImageStoreFS) GetReferrers(repo, digest, mediaType string) ([]artifactspec.Descriptor, error)
func (*ImageStoreFS) GetRepositories ¶
func (is *ImageStoreFS) GetRepositories() ([]string, error)
GetRepositories returns a list of all the repositories under this store.
func (*ImageStoreFS) InitRepo ¶
func (is *ImageStoreFS) InitRepo(name string) error
InitRepo creates an image repository under this store.
func (*ImageStoreFS) NewBlobUpload ¶
func (is *ImageStoreFS) NewBlobUpload(repo string) (string, error)
NewBlobUpload returns the unique ID for an upload in progress.
func (*ImageStoreFS) PutBlobChunk ¶
func (is *ImageStoreFS) 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 (*ImageStoreFS) PutBlobChunkStreamed ¶
PutBlobChunkStreamed appends another chunk of data to the specified blob. It returns the number of actual bytes to the blob.
func (*ImageStoreFS) PutImageManifest ¶
func (is *ImageStoreFS) PutImageManifest(repo, reference, mediaType string, body []byte, ) (string, error)
PutImageManifest adds an image manifest to the repository.
func (*ImageStoreFS) RUnlock ¶
func (is *ImageStoreFS) RUnlock(lockStart *time.Time)
RUnlock read-unlock.
func (*ImageStoreFS) RootDir ¶
func (is *ImageStoreFS) RootDir() string
func (*ImageStoreFS) RunGCRepo ¶ added in v1.4.1
func (is *ImageStoreFS) RunGCRepo(repo string)
func (*ImageStoreFS) Unlock ¶
func (is *ImageStoreFS) Unlock(lockStart *time.Time)
Unlock write-unlock.
func (*ImageStoreFS) ValidateRepo ¶
func (is *ImageStoreFS) ValidateRepo(name string) (bool, error)
ValidateRepo validates that the repository layout is complaint with the OCI repo layout.
type ScrubImageResult ¶ added in v1.3.6
type ScrubImageResult struct { ImageName string `json:"imageName"` Tag string `json:"tag"` Status string `json:"status"` Error string `json:"error"` }
func CheckImageStoreBlobsIntegrity ¶ added in v1.4.0
func CheckImageStoreBlobsIntegrity(imgStore ImageStore) ([]ScrubImageResult, error)
func CheckRepo ¶ added in v1.4.1
func CheckRepo(imageName string, imgStore ImageStore) ([]ScrubImageResult, error)
type ScrubResults ¶ added in v1.3.6
type ScrubResults struct {
ScrubResults []ScrubImageResult `json:"scrubResults"`
}
func (ScrubResults) PrintScrubResults ¶ added in v1.3.6
func (results ScrubResults) PrintScrubResults(resultWriter io.Writer)
type StoreController ¶
type StoreController struct { DefaultStore ImageStore SubStore map[string]ImageStore }
func (StoreController) CheckAllBlobsIntegrity ¶ added in v1.3.6
func (sc StoreController) CheckAllBlobsIntegrity() (ScrubResults, error)
func (StoreController) GetImageStore ¶
func (sc StoreController) GetImageStore(name string) ImageStore