blobstore

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2026 License: Apache-2.0 Imports: 30 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound           = errors.New("object not found")
	ErrPreconditionFailed = errors.New("precondition failed")
	ErrBucketNameRequired = errors.New("bucket name required for cloud providers")
)

Functions

This section is empty.

Types

type Attributes

type Attributes struct {
	Size    int64
	ETag    string
	ModTime time.Time
	// Generation is used/set for GCS. GCS Doesn't use Etag.
	Generation int64
}

type BatchDeleteError

type BatchDeleteError struct {
	Failed map[string]error
}

func (*BatchDeleteError) Error

func (e *BatchDeleteError) Error() string

type ListOptions

type ListOptions struct {
	Prefix    string
	Delimiter string
}

type ListResult

type ListResult struct {
	Objects []ObjectInfo
}

type ObjectInfo

type ObjectInfo struct {
	Key   string
	Size  int64
	IsDir bool
}

type Store

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

func New

func New(bkt *blob.Bucket, bucketName, prefix string) *Store

New wraps an existing bucket. For cloud providers, bucketName is required for CAS writes; use Open() when possible.

func NewMemory

func NewMemory(prefix string) *Store

NewMemory creates an in-memory store for testing.

func Open

func Open(ctx context.Context, bucketURL, prefix string) (*Store, error)

func (*Store) Attributes

func (s *Store) Attributes(ctx context.Context, key string) (Attributes, error)

func (*Store) BatchDelete

func (s *Store) BatchDelete(ctx context.Context, keys []string) error

func (*Store) BlobPath

func (s *Store) BlobPath(blobID string) string

func (*Store) Bucket

func (s *Store) Bucket() *blob.Bucket

func (*Store) Close

func (s *Store) Close() error

func (*Store) DebugString

func (s *Store) DebugString() string

func (*Store) Delete

func (s *Store) Delete(ctx context.Context, key string) error

func (*Store) Exists

func (s *Store) Exists(ctx context.Context, key string) (bool, error)

func (*Store) List

func (s *Store) List(ctx context.Context, opts ListOptions) (*ListResult, error)

func (*Store) ListBlobFiles

func (s *Store) ListBlobFiles(ctx context.Context) ([]ObjectInfo, error)

func (*Store) ListManifestLogs

func (s *Store) ListManifestLogs(ctx context.Context) ([]ObjectInfo, error)

func (*Store) ListSSTFiles

func (s *Store) ListSSTFiles(ctx context.Context) ([]ObjectInfo, error)

func (*Store) ListVLogFiles

func (s *Store) ListVLogFiles(ctx context.Context) ([]ObjectInfo, error)

func (*Store) ManifestLogPath

func (s *Store) ManifestLogPath(id string) string

func (*Store) ManifestPath

func (s *Store) ManifestPath() string

func (*Store) ManifestSnapshotPath

func (s *Store) ManifestSnapshotPath(id string) string

func (*Store) Prefix

func (s *Store) Prefix() string

func (*Store) Read

func (s *Store) Read(ctx context.Context, key string) ([]byte, Attributes, error)

func (*Store) ReadRange

func (s *Store) ReadRange(ctx context.Context, key string, offset, length int64) ([]byte, error)

func (*Store) ReadRangeStream

func (s *Store) ReadRangeStream(ctx context.Context, key string, offset, length int64) (*blob.Reader, error)

func (*Store) ReadStream

func (s *Store) ReadStream(ctx context.Context, key string) (*blob.Reader, error)

func (*Store) SSTPath

func (s *Store) SSTPath(id string) string

func (*Store) VLogPath

func (s *Store) VLogPath(id string) string

func (*Store) Write

func (s *Store) Write(ctx context.Context, key string, data []byte) (Attributes, error)

func (*Store) WriteIfMatch

func (s *Store) WriteIfMatch(ctx context.Context, key string, data []byte, ifMatch string) (Attributes, error)

func (*Store) WriteIfNotExist

func (s *Store) WriteIfNotExist(ctx context.Context, key string, data []byte) (Attributes, error)

func (*Store) WriteReader

func (s *Store) WriteReader(ctx context.Context, key string, r io.Reader, opts *blob.WriterOptions) (Attributes, error)

Jump to

Keyboard shortcuts

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