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.
Click to show internal directories.
Click to hide internal directories.