blob

package
v0.0.4-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PARTITION_BLOBS = "blobs"
)

Variables

View Source
var (
	ErrBlobNotFound = errors.New("store/blob: blob not found")
)

Functions

This section is empty.

Types

type BlobStore

type BlobStore struct {
	BlobStorer
	// contains filtered or unexported fields
}

func (*BlobStore) Count

func (store *BlobStore) Count(partition *string) (int, error)

Deleted blob the blob store. ErrBlobNotFound is returned if the provided blob key could not be found.

func (*BlobStore) Delete

func (store *BlobStore) Delete(key []byte) error

Deleted blob the blob store. ErrBlobNotFound is returned if the provided blob key could not be found.

func (*BlobStore) Exists

func (store *BlobStore) Exists(key []byte) bool

Returns true if the file exists

func (*BlobStore) Get

func (store *BlobStore) Get(key []byte) ([]byte, error)

Retrieves a signed blob from the "signed" partition. ErrBlobNotFound is returned if the signed data could not be found.

func (*BlobStore) Save

func (store *BlobStore) Save(key, data []byte) error

Saves a blob to the blob store. If the blob key contains forward slashes, a directory hierarchy will be created to match the key. For example, the blob key /my/secret/blob.dat would get saved to platform-dir/blobs/my/secret/blob.dat

type BlobStorer

type BlobStorer interface {
	Delete(key []byte) error
	Exists(key []byte) bool
	Get(key []byte) ([]byte, error)
	Save(key, data []byte) error
	Count(partition *string) (int, error)
}

func NewFSBlobStore

func NewFSBlobStore(
	logger *logging.Logger,
	fs afero.Fs,
	rootDir string,
	partition *string) (BlobStorer, error)

Creates a new local file system backed blob store

Jump to

Keyboard shortcuts

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