blob

package
v0.0.6-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2024 License: Apache-2.0 Imports: 8 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

Deletes a blob from 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 blob with the provided key exists

func (*BlobStore) Get

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

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

func (*BlobStore) Home

func (store *BlobStore) Home() string

Returns the blob store's home directory

func (*BlobStore) Partition

func (store *BlobStore) Partition() string

Returns the blob store's partition name

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 {
	Count(partition *string) (int, error)
	Delete(key []byte) error
	Exists(key []byte) bool
	Get(key []byte) ([]byte, error)
	Home() string
	Partition() string
	Save(key, data []byte) 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