nats

package
v0.0.30 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 1, 2024 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MetadataKeyEventName             = "event-name"
	MetadataKeyEventTime             = "event-time"
	MetadataKeyEventAggregateName    = "aggregate-name"
	MetadataKeyEventAggregateId      = "aggregate-id"
	MetadataKeyEventAggregateVersion = "aggregate-version"
)

Event metadata keys

Variables

View Source
var (
	ErrLeaseLocked               = errors.New("lease is currently locked")
	ErrValidationVersionMismatch = errors.New("validation version mismatch")
)

Error

Functions

This section is empty.

Types

type ApplyStoreOptionFunc added in v0.0.22

type ApplyStoreOptionFunc func(c *Store) error

type Store

type Store struct {
	// contains filtered or unexported fields
}

func New

func New(nc *nats.Conn, enc codec.Encoding, opts ...StoreOption) (*Store, error)

func (*Store) Delete

func (s *Store) Delete(_ context.Context, _ ...event.Event) error

Delete deletes events from the store.

func (*Store) Find

func (s *Store) Find(_ context.Context, _ uuid.UUID) (event.Event, error)

Find fetches the given event from the store.

func (*Store) Insert

func (s *Store) Insert(ctx context.Context, evts ...event.Event) error

Insert inserts events into the store.

func (*Store) Query

func (s *Store) Query(ctx context.Context, q event.Query) (<-chan event.Event, <-chan error, error)

Query queries the store for events and returns two channels – one for the returned events and one for any asynchronous errors that occur during the query.

type StoreOption added in v0.0.22

type StoreOption interface {
	// contains filtered or unexported methods
}

func WithLogger added in v0.0.22

func WithLogger(o *zap.SugaredLogger) StoreOption

func WithPullExpiry added in v0.0.22

func WithPullExpiry(o time.Duration) StoreOption

func WithRetryCount added in v0.0.22

func WithRetryCount(o uint) StoreOption

func WithVersionKV added in v0.0.27

func WithVersionKV(o kv.KeyValuer[*kv.UInt64Value]) StoreOption

func WithWriteLeaseKV added in v0.0.26

func WithWriteLeaseKV(o kv.KeyValuer[*kv.NilValue]) StoreOption

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL