blobstore

package
v0.1.15 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package blobstore provides an interface for object storage operations.

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("blobstore: object not found")

ErrNotFound is returned by Store.Get when the requested object does not exist.

Functions

func ReadAll

func ReadAll(ctx context.Context, bs Store, key string) ([]byte, error)

ReadAll reads and returns all bytes from the blob at key. Returns any error from Get or from reading the stream.

Types

type Store

type Store interface {
	// Put uploads data to the store at the given key.
	// Returns the etag of the uploaded object.
	Put(ctx context.Context, key, contentType string, data []byte) (etag string, err error)

	// Get retrieves an object from the store.
	// Caller is responsible for closing the returned ReadCloser.
	Get(ctx context.Context, key string) (rc io.ReadCloser, size int64, err error)

	// Delete removes an object from the store.
	Delete(ctx context.Context, key string) error
}

Store defines the interface for blob storage operations.

Directories

Path Synopsis
Package mock provides an in-memory implementation of blobstore.Store for testing.
Package mock provides an in-memory implementation of blobstore.Store for testing.
Package s3 provides an S3-compatible implementation of blobstore.Store.
Package s3 provides an S3-compatible implementation of blobstore.Store.

Jump to

Keyboard shortcuts

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