cachestore

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: May 20, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package cachestore defines the in-DC chunk store interface and shared types. Concrete drivers live under cachestore/<driver>/.

All drivers must implement atomic commit (CAS-style PutChunk that rejects overwrites) so concurrent fills across replicas converge without clobbering each other; SelfTestAtomicCommit is run at boot to verify the backend honors the precondition.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound   = errors.New("cachestore: not found")
	ErrTransient  = errors.New("cachestore: transient")
	ErrAuth       = errors.New("cachestore: auth")
	ErrCommitLost = errors.New("cachestore: commit lost (no-clobber denied)")
)

Sentinel errors. Wrap with %w so callers use errors.Is.

Functions

This section is empty.

Types

type CacheStore

type CacheStore interface {
	GetChunk(ctx context.Context, k chunk.Key, off, n int64) (io.ReadCloser, error)
	PutChunk(ctx context.Context, k chunk.Key, size int64, r io.Reader) error
	Stat(ctx context.Context, k chunk.Key) (Info, error)
	Delete(ctx context.Context, k chunk.Key) error
	SelfTestAtomicCommit(ctx context.Context) error
}

CacheStore is where chunk bytes physically live. Source of truth for chunk presence; backed by an in-DC S3-like store in production and LocalStack in dev.

type Info

type Info struct {
	Size      int64
	Committed time.Time
}

Info is the result of a successful Stat.

Directories

Path Synopsis
Package s3 is the cachestore driver for in-DC S3-compatible stores.
Package s3 is the cachestore driver for in-DC S3-compatible stores.

Jump to

Keyboard shortcuts

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