Documentation ¶
Index ¶
Constants ¶
View Source
const ( BackendTypeOSS = "oss" BackendTypeS3 = "s3" BackendTypeLocalFS = "localfs" )
Variables ¶
View Source
var ( // We always use multipart upload for backend, and limit the // multipart chunk size to 500MB by default. MultipartChunkSize int64 = 500 * 1024 * 1024 )
Functions ¶
This section is empty.
Types ¶
type Backend ¶
type Backend interface { // Push pushes specified blob file to remote storage backend. Push(ctx context.Context, cs content.Store, desc ocispec.Descriptor) error // Check checks whether a blob exists in remote storage backend, // blob exists -> return (blobPath, nil) // blob not exists -> return ("", err) Check(blobDigest digest.Digest) (string, error) // Type returns backend type name. Type() string }
Backend uploads blobs generated by nydus-image builder to a backend storage.
func NewBackend ¶
Nydus driver majorly works for registry backend, which means blob is stored in registry as per OCI distribution specification. But nydus can also make OSS or other storage services as backend storage. Pass config as byte slice here because we haven't find a way to represent all backend config at the same time.
type LocalFSBackend ¶
type LocalFSBackend struct {
// contains filtered or unexported fields
}
func (*LocalFSBackend) Check ¶
func (b *LocalFSBackend) Check(blobDigest digest.Digest) (string, error)
func (*LocalFSBackend) Push ¶
func (b *LocalFSBackend) Push(ctx context.Context, cs content.Store, desc ocispec.Descriptor) error
func (*LocalFSBackend) Type ¶
func (b *LocalFSBackend) Type() string
type OSSBackend ¶
type OSSBackend struct {
// contains filtered or unexported fields
}
func (*OSSBackend) Check ¶
func (b *OSSBackend) Check(blobDigest digest.Digest) (string, error)
func (*OSSBackend) Push ¶
func (b *OSSBackend) Push(ctx context.Context, cs content.Store, desc ocispec.Descriptor) error
func (*OSSBackend) Type ¶
func (b *OSSBackend) Type() string
type S3Backend ¶ added in v0.5.0
type S3Backend struct {
// contains filtered or unexported fields
}
type S3Config ¶ added in v0.5.0
type S3Config struct { AccessKeyID string `json:"access_key_id,omitempty"` AccessKeySecret string `json:"access_key_secret,omitempty"` Endpoint string `json:"endpoint,omitempty"` Scheme string `json:"scheme,omitempty"` BucketName string `json:"bucket_name,omitempty"` Region string `json:"region,omitempty"` ObjectPrefix string `json:"object_prefix,omitempty"` }
Click to show internal directories.
Click to hide internal directories.