Documentation
¶
Overview ¶
Package fstest provides in-memory test doubles for exercising the filesystem service without a Raft cluster.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMemoryService ¶
func NewMemoryService(opts ...filesystem.Option) (*filesystem.Service, error)
NewMemoryService builds a filesystem.Service over a fresh in-memory MVCC store and a MemoryDispatcher.
Types ¶
type MemoryDispatcher ¶
type MemoryDispatcher struct {
// contains filtered or unexported fields
}
MemoryDispatcher applies operation groups directly to an MVCC store. It satisfies filesystem.Dispatcher and the optional linearizable-read fence so tests can drive filesystem.Service end to end without replication.
func NewMemoryDispatcher ¶
func NewMemoryDispatcher(st store.MVCCStore) *MemoryDispatcher
NewMemoryDispatcher wraps st in a dispatcher that commits every group at the next commit timestamp.
func (*MemoryDispatcher) Dispatch ¶
func (d *MemoryDispatcher) Dispatch( ctx context.Context, req *kv.OperationGroup[kv.OP], ) (*kv.CoordinateResponse, error)
Dispatch applies the group's mutations atomically at a fresh commit timestamp, validating OCC read keys against the group's start timestamp.
func (*MemoryDispatcher) LinearizableRead ¶
func (d *MemoryDispatcher) LinearizableRead(context.Context) (uint64, error)
LinearizableRead returns the latest applied commit timestamp.