backend

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2022 License: Apache-2.0 Imports: 13 Imported by: 1

Documentation

Index

Constants

View Source
const (
	BackendTypeOSS     = "oss"
	BackendTypeLocalFS = "localfs"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend interface {
	// Push pushes specified blob file to remote storage backend.
	Push(ctx context.Context, ra content.ReaderAt, blobDigest digest.Digest) 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 such as: - oss: A object storage backend, which uses its SDK to upload blob file.

func NewBackend

func NewBackend(_type string, config []byte) (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 (b *LocalFSBackend) Push(ctx context.Context, ra content.ReaderAt, blobDigest digest.Digest) 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, ra content.ReaderAt, blobDigest digest.Digest) error

func (*OSSBackend) Type

func (b *OSSBackend) Type() string

Jump to

Keyboard shortcuts

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