Documentation ¶
Index ¶
- Variables
- func Apply[T any](d T, mutations ...Mutation[T]) (T, error)
- func NewMutator[T, M any](name string, fn func(T, M) (T, error)) *mutator[T, M]
- type Conn
- type Cursor
- type ErrConflict
- type Listener
- type Meta
- type Mutation
- type Mutator
- type Projection
- type Store
- func (s *Store) Append(ctx context.Context, entityID string, mutations ...Mutation[T]) (Projection[T], error)
- func (s *Store) AppendAfter(ctx context.Context, entityID, mutationID string, mutations ...Mutation[T]) (Projection[T], error)
- func (s *Store) Conn() Conn
- func (s *Store) Get(ctx context.Context, id string) (Projection[T], error)
- func (s *Store) GetAll(ctx context.Context) (Cursor[T], error)
- func (s *Store) GetAt(ctx context.Context, id, mutationID string) (Projection[T], error)
- func (s *Store) Tx(tx pgx.Tx) *store[T]
- func (s *Store[T]) WithIDGenerator(fn func() (string, error)) *Store[T]
- func (s *Store[T]) WithMutators(mutators ...Mutator[T]) *Store[T]
- type Type
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotFound = errors.New("not found")
Functions ¶
func NewMutator ¶
Types ¶
type Cursor ¶
type Cursor[T any] struct { // contains filtered or unexported fields }
func (Cursor[T]) Next ¶
func (c Cursor[T]) Next() (Projection[T], error)
type ErrConflict ¶
type ErrConflict struct {
CurrentMutationID, ExpectedMutationID string
}
func (*ErrConflict) Error ¶
func (e *ErrConflict) Error() string
type Listener ¶
type Listener[T any] struct { // contains filtered or unexported fields }
func NewListener ¶
func (*Listener[T]) WaitForProjection ¶
func (l *Listener[T]) WaitForProjection(ctx context.Context) (Projection[T], error)
type Projection ¶
type Store ¶
type Store[T any] struct { // contains filtered or unexported fields }
func (*Store) AppendAfter ¶
func (*Store) GetAt ¶
func (s *Store) GetAt(ctx context.Context, id, mutationID string) (Projection[T], error)
func (*Store[T]) WithIDGenerator ¶
func (*Store[T]) WithMutators ¶
type Type ¶
type Type[T any] struct { // contains filtered or unexported fields }
func (*Type[T]) WithValidator ¶
Click to show internal directories.
Click to hide internal directories.