Documentation
¶
Overview ¶
Package refstore persists reference records in a Pebble DB: name bytes → CBOR record bytes, stored verbatim. It is a dumb KV layer; record validation belongs to the daemon and the reference package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNotFound = errors.New("refstore: reference not found")
ErrNotFound is returned by Get and Delete for an absent name.
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is a Pebble-backed name→record map. It is safe for concurrent use. Readers (Get, All) are lock-free; writes (Put, Delete) are serialized via writeMu so that Delete's existence check is linearizable against other writers.
func Open ¶
Open opens (creating if missing) the refs DB at dir. sync selects the write durability, matching the daemon's --sync flag.
func (*Store) Delete ¶
Delete removes name, or returns ErrNotFound if absent. The existence check and the delete are serialized against other writes via writeMu, so concurrent Deletes of the same name report ErrNotFound to all but one caller.