Documentation ¶
Overview ¶
Package monitor implements common plumbing for implementations of the blob.Store interface based on storage with a flat key space.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config[DB any, KV blob.KV] struct { // DB represents the initial state of the monitor. DB DB // Prefix gives the initial storage prefix of the root. Prefix dbkey.Prefix // NewKV construts a KV instance from the current state. NewKV func(context.Context, DB, dbkey.Prefix, string) (KV, error) // NewSub constructs a sub-DB state from the current state. // If nil, the existing state is copied. NewSub func(context.Context, DB, dbkey.Prefix, string) (DB, error) }
Config carries settings for construction of an M.
type M ¶
A M value manages keyspace and substore allocations for the specified database and KV implementations. The resulting value implements blob.Store.
func New ¶
New constructs a new empty store using the specified database, prefix, and KV constructor function. New will panic if newKV == nil.
func (*M[DB, KV]) CAS ¶ added in v0.9.0
CAS implements a method of blob.Store.
func (*M[DB, KV]) KV ¶ added in v0.9.0
KV implements a method of blob.Store. A successful result has concrete type [KV]. This method never reports an error.
Click to show internal directories.
Click to hide internal directories.