blenc

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2023 License: Apache-2.0 Imports: 14 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidDynamicLinkWriterInfo = errors.New("incorrect dynamic link writer info")
)
View Source
var (
	ErrNotFound = datastore.ErrNotFound
)

Functions

This section is empty.

Types

type AuthInfo

type AuthInfo = []byte

type BE

type BE interface {

	// Open opens given blob data for reading.
	//
	// If returned error is not nil, the reader must be nil. Otherwise it is required to
	// close the reader once done working with it.
	Open(ctx context.Context, name common.BlobName, key EncryptionKey) (io.ReadCloser, error)

	// Create completely new blob with given dataset, as a result, the blob name and optional
	// AuthInfo that allows blob's update is returned
	Create(ctx context.Context, blobType common.BlobType, r io.Reader) (common.BlobName, EncryptionKey, AuthInfo, error)

	// Update updates given blob type with new data,
	// The update must happen within a single blob name (i.e. it can not end up with blob with different name)
	// and may not be available for certain blob types such as static blobs.
	// A valid writer info is necessary to ensure a correct new content can be created
	Update(ctx context.Context, name common.BlobName, ai AuthInfo, key EncryptionKey, r io.Reader) error

	// Exists does check whether blob of given name exists. It forwards the call
	// to underlying datastore.
	Exists(ctx context.Context, name common.BlobName) (bool, error)

	// Delete tries to remove blob with given name. It forwards the call to
	// underlying datastore.
	Delete(ctx context.Context, name common.BlobName) error
}

BE interface describes functionality exposed by Blob Encryption layer implementation

func FromDatastore

func FromDatastore(ds datastore.DS) BE

FromDatastore creates Blob Encoder using given datastore implementation as the storage layer

type EncryptionKey

type EncryptionKey = cipherfactory.Key

Jump to

Keyboard shortcuts

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