backend

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2024 License: Apache-2.0 Imports: 22 Imported by: 1

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

func NewBackend(_type string, config []byte, forcePush bool) (Backend, error)

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 (*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
}

func (*S3Backend) Check added in v0.5.0

func (b *S3Backend) Check(blobDigest digest.Digest) (string, error)

func (*S3Backend) Push added in v0.5.0

func (b *S3Backend) Push(ctx context.Context, cs content.Store, desc ocispec.Descriptor) error

func (*S3Backend) Type added in v0.5.0

func (b *S3Backend) Type() string

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"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL