Documentation ¶
Overview ¶
Package recstore provides a typed etcd storage for keys.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AlreadyExistsTag ¶
type AlreadyExistsTag struct{}
AlreadyExistsTag is an error tag that is returned when a key already exists.
type RecStore ¶
type RecStore[T any] struct { // contains filtered or unexported fields }
RecStore is etcd record storage for the specific type.
func New ¶
func New[T any]( client clientv3.KV, name string, prefix string, marshal func(T) ([]byte, error), unmarshal func([]byte) (T, error), ) *RecStore[T]
New creates a new record store.
func (*RecStore[T]) Create ¶
Create marshals and stores the value for the given key for the selected version. It returns an error if the key already exists.
type TxVersionConflictTag ¶
type TxVersionConflictTag struct{}
TxVersionConflictTag is an error tag when version conflict that happens in a transaction.
type VersionConflictTag ¶
type VersionConflictTag struct{}
VersionConflictTag is an error tag when the version of the record does not match the expected version.
Click to show internal directories.
Click to hide internal directories.