2019-06-20 18:36:40 -05:00
|
|
|
package storage
|
|
|
|
|
|
|
|
import (
|
|
|
|
"io"
|
2021-12-21 08:19:40 -05:00
|
|
|
"time"
|
2019-06-20 18:36:40 -05:00
|
|
|
|
2021-09-30 08:27:13 -05:00
|
|
|
"github.com/opencontainers/go-digest"
|
2022-01-31 16:33:07 -05:00
|
|
|
artifactspec "github.com/oras-project/artifacts-spec/specs-go/v1"
|
2019-06-20 18:36:40 -05:00
|
|
|
)
|
|
|
|
|
2021-07-16 22:53:05 -05:00
|
|
|
const (
|
|
|
|
S3StorageDriverName = "s3"
|
2022-02-09 19:51:35 -05:00
|
|
|
DefaultGCDelay = 1 * time.Hour
|
2021-07-16 22:53:05 -05:00
|
|
|
)
|
|
|
|
|
2021-09-30 08:27:13 -05:00
|
|
|
type ImageStore interface {
|
|
|
|
DirExists(d string) bool
|
|
|
|
RootDir() string
|
2021-12-21 08:19:40 -05:00
|
|
|
RLock(*time.Time)
|
|
|
|
RUnlock(*time.Time)
|
|
|
|
Lock(*time.Time)
|
|
|
|
Unlock(*time.Time)
|
2021-09-30 08:27:13 -05:00
|
|
|
InitRepo(name string) error
|
|
|
|
ValidateRepo(name string) (bool, error)
|
|
|
|
GetRepositories() ([]string, error)
|
|
|
|
GetImageTags(repo string) ([]string, error)
|
2022-03-21 12:37:23 -05:00
|
|
|
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
|
2021-09-30 08:27:13 -05:00
|
|
|
NewBlobUpload(repo string) (string, error)
|
2022-03-21 12:37:23 -05:00
|
|
|
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
|
2021-09-30 08:27:13 -05:00
|
|
|
FullBlobUpload(repo string, body io.Reader, digest string) (string, int64, error)
|
|
|
|
DedupeBlob(src string, dstDigest digest.Digest, dst string) error
|
2022-03-21 12:37:23 -05:00
|
|
|
DeleteBlobUpload(repo, uuid string) error
|
2021-09-30 08:27:13 -05:00
|
|
|
BlobPath(repo string, digest digest.Digest) string
|
2022-03-21 12:37:23 -05:00
|
|
|
CheckBlob(repo, digest string) (bool, int64, error)
|
2022-08-19 05:38:59 -05:00
|
|
|
GetBlob(repo, digest, mediaType string) (io.ReadCloser, int64, error)
|
2022-03-21 12:37:23 -05:00
|
|
|
DeleteBlob(repo, digest string) error
|
2021-09-30 08:27:13 -05:00
|
|
|
GetIndexContent(repo string) ([]byte, error)
|
|
|
|
GetBlobContent(repo, digest string) ([]byte, error)
|
2022-01-31 16:33:07 -05:00
|
|
|
GetReferrers(repo, digest string, mediaType string) ([]artifactspec.Descriptor, error)
|
2022-05-09 17:30:11 -05:00
|
|
|
RunGCRepo(repo string)
|
2020-06-30 12:56:58 -05:00
|
|
|
}
|