blob

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 26, 2026 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BackendMemory     = "memory"
	BackendFilesystem = "filesystem"
	BackendS3         = "s3"
)

Variables

View Source
var ErrInvalidInput = errors.New("invalid blob input")
View Source
var ErrNotFound = errors.New("blob not found")
View Source
var ErrUnavailable = errors.New("blob backend unavailable")

Functions

This section is empty.

Types

type Checker

type Checker interface {
	Exists(context.Context, string) (bool, error)
}

type Deleter

type Deleter interface {
	Delete(context.Context, string) error
}

type FileStore

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

func NewFileStore

func NewFileStore(target string) (*FileStore, error)

func (*FileStore) Delete

func (s *FileStore) Delete(_ context.Context, key string) error

func (*FileStore) Exists

func (s *FileStore) Exists(_ context.Context, key string) (bool, error)

func (*FileStore) Get

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

func (*FileStore) List

func (s *FileStore) List(_ context.Context) ([]string, error)

List returns the flat checksum keys currently present in the filesystem backend, giving migration tooling a safe way to report orphan candidates.

func (*FileStore) Name

func (s *FileStore) Name() string

func (*FileStore) Put

func (s *FileStore) Put(_ context.Context, req PutRequest) (PutResult, error)

func (*FileStore) Status

func (s *FileStore) Status() Status

type Getter

type Getter interface {
	Get(context.Context, string) ([]byte, error)
}

type Lister

type Lister interface {
	List(context.Context) ([]string, error)
}

Lister is an optional safe inventory capability for local/provider adapters that can enumerate checksum keys without mutating blob contents.

type MemoryStore

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

func NewMemoryStore

func NewMemoryStore(target string) *MemoryStore

func (*MemoryStore) Delete

func (s *MemoryStore) Delete(_ context.Context, key string) error

func (*MemoryStore) Exists

func (s *MemoryStore) Exists(_ context.Context, key string) (bool, error)

func (*MemoryStore) Get

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

func (*MemoryStore) List

func (s *MemoryStore) List(_ context.Context) ([]string, error)

List returns the in-memory checksum keys for local migration tests and memory-backed development runs without exposing mutable object internals.

func (*MemoryStore) Name

func (s *MemoryStore) Name() string

func (*MemoryStore) Put

func (*MemoryStore) Status

func (s *MemoryStore) Status() Status

type NoopStore

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

func NewNoopStore

func NewNoopStore(target string) NoopStore

func (NoopStore) Name

func (s NoopStore) Name() string

func (NoopStore) Status

func (s NoopStore) Status() Status

type Object

type Object struct {
	ContentType string
	Body        []byte
}

type PutRequest

type PutRequest struct {
	Key         string
	ContentType string
	Body        []byte
}

type PutResult

type PutResult struct {
	Location string
}

type Putter

type Putter interface {
	Put(context.Context, PutRequest) (PutResult, error)
}

type S3CompatibleConfig

type S3CompatibleConfig struct {
	StorageURL     string
	Endpoint       string
	Region         string
	ForcePathStyle bool
	DisableTLS     bool
	AccessKeyID    string
	SecretKey      string
	SessionToken   string
	RequestTimeout time.Duration
	MaxRetries     int
	HTTPClient     *http.Client
	Now            func() time.Time
	Sleep          func(context.Context, time.Duration) error
}

type S3CompatibleStore

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

func NewS3CompatibleStore

func NewS3CompatibleStore(cfg S3CompatibleConfig) (*S3CompatibleStore, error)

func (*S3CompatibleStore) Delete

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

func (*S3CompatibleStore) Exists

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

func (*S3CompatibleStore) Get

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

func (*S3CompatibleStore) Name

func (s *S3CompatibleStore) Name() string

func (*S3CompatibleStore) Put

func (*S3CompatibleStore) Status

func (s *S3CompatibleStore) Status() Status

type Status

type Status struct {
	Backend    string `json:"backend"`
	Configured bool   `json:"configured"`
	Message    string `json:"message"`
}

type Store

type Store interface {
	Name() string
	Status() Status
}

func NewStore

func NewStore(cfg config.Config) (Store, error)

Jump to

Keyboard shortcuts

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