badger

package
v0.14.5 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package badger implements the blobserver interface by storing each blob in a outcaste-io/badger database.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BlobRefBytes

func BlobRefBytes(prefix string, br blob.Ref) []byte

Types

type Storage

type Storage struct {
	// contains filtered or unexported fields
}

func New

func New(root, prefix string) (Storage, error)

func NewManaged

func NewManaged(db *badgerdb.DB, prefix string) Storage

NewManaged uses the given badgerdb.DB.

func (Storage) Close

func (sto Storage) Close() error

func (Storage) EnumerateBlobs

func (sto Storage) EnumerateBlobs(ctx context.Context, dest chan<- blob.SizedRef, after string, limit int) error

func (Storage) Fetch

func (sto Storage) Fetch(ctx context.Context, br blob.Ref) (io.ReadCloser, uint32, error)

func (Storage) ReceiveBlob

func (sto Storage) ReceiveBlob(ctx context.Context, br blob.Ref, source io.Reader) (blob.SizedRef, error)

func (Storage) RemoveBlobs

func (sto Storage) RemoveBlobs(ctx context.Context, blobs []blob.Ref) error

func (Storage) ResetStorageGeneration

func (sto Storage) ResetStorageGeneration() error

func (Storage) StatBlobs

func (sto Storage) StatBlobs(ctx context.Context, blobs []blob.Ref, fn func(blob.SizedRef) error) error

func (Storage) StorageGeneration

func (sto Storage) StorageGeneration() (initTime time.Time, random string, err error)

Jump to

Keyboard shortcuts

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