blob

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("blob not found")

ErrNotFound indicates the requested object does not exist in the store.

View Source
var ErrStorage = errors.New("blob storage error")

ErrStorage wraps any non-not-found failure from the underlying blob backend (e.g. S3 connectivity/permission errors). Callers can use errors.Is to map storage failures to a 500 while keeping the original cause via %w.

Functions

This section is empty.

Types

type Memory

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

func NewMemory

func NewMemory() *Memory

func (*Memory) Delete

func (m *Memory) Delete(ctx context.Context, key string) error

func (*Memory) Get

func (m *Memory) Get(ctx context.Context, key string) ([]byte, string, error)

func (*Memory) Ping

func (m *Memory) Ping(ctx context.Context) error

func (*Memory) Put

func (m *Memory) Put(ctx context.Context, key, contentType string, body []byte) error

type Pinger

type Pinger interface {
	Ping(ctx context.Context) error
}

type S3

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

func NewS3

func NewS3(ctx context.Context, c S3Config) (*S3, error)

func (*S3) Delete

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

func (*S3) Get

func (s *S3) Get(ctx context.Context, key string) ([]byte, string, error)

func (*S3) Ping

func (s *S3) Ping(ctx context.Context) error

func (*S3) Put

func (s *S3) Put(ctx context.Context, key, contentType string, body []byte) error

type S3Config

type S3Config struct {
	Bucket          string
	Region          string
	Endpoint        string
	AccessKeyID     string
	SecretAccessKey string
	ForcePathStyle  bool
}

type Store

type Store interface {
	Put(ctx context.Context, key string, contentType string, body []byte) error
	Get(ctx context.Context, key string) ([]byte, string, error)
	Delete(ctx context.Context, key string) error
}

Jump to

Keyboard shortcuts

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