Versions in this module Expand all Collapse all v0 v0.0.2 May 18, 2021 Changes in this version + func RpcSessionStreamInterceptor(_ *pgxpool.Pool, logger log.Logger) grpc.StreamServerInterceptor + func RpcSessionUnaryInterceptor(conn *pgxpool.Pool, logger log.Logger) grpc.UnaryServerInterceptor v0.0.1 Jan 7, 2021 Changes in this version + const CreateEventsTableSQL + const CreateMessagesPublishedIndexSQL + const CreateMessagesTableSQL + const CreateMessagesUnpublishedIndexSQL + const CreateSagaInstancesTableSQL + const CreateSnapshotsTableSQL + const DefaultEventTableName + const DefaultMessageTableName + const DefaultSagaInstanceTableName + const DefaultSnapshotTableName + var ErrInvalidTxValue = errors.New("tx value is not a pgx.Tx type") + var ErrTxNotInContext = errors.New("pgx.Tx is not set for session") + func NewSnapshotStore(client Client, options ...SnapshotStoreOption) es.AggregateRootStoreMiddleware + func ReceiverSessionMiddleware(conn *pgxpool.Pool, logger log.Logger) func(msg.MessageReceiver) msg.MessageReceiver + func WebSessionMiddleware(conn *pgxpool.Pool, logger log.Logger) func(http.Handler) http.Handler + type Client interface + Begin func(ctx context.Context) (pgx.Tx, error) + BeginTx func(ctx context.Context, txOptions pgx.TxOptions) (pgx.Tx, error) + Exec func(ctx context.Context, sql string, arguments ...interface{}) (pgconn.CommandTag, error) + Query func(ctx context.Context, sql string, args ...interface{}) (pgx.Rows, error) + QueryFunc func(ctx context.Context, sql string, args []interface{}, scans []interface{}, ...) (pgconn.CommandTag, error) + QueryRow func(ctx context.Context, sql string, args ...interface{}) pgx.Row + SendBatch func(ctx context.Context, b *pgx.Batch) pgx.BatchResults + func NewSessionClient() Client + type EventStore struct + func NewEventStore(client Client, options ...EventStoreOption) *EventStore + func (s *EventStore) Load(ctx context.Context, root *es.AggregateRoot) error + func (s *EventStore) Save(ctx context.Context, root *es.AggregateRoot) (err error) + type EventStoreOption func(*EventStore) + func WithEventStoreLogger(logger log.Logger) EventStoreOption + func WithEventStoreTableName(tableName string) EventStoreOption + type MessageStore struct + func NewMessageStore(client Client, options ...MessageStoreOption) *MessageStore + func (s *MessageStore) Close(ctx context.Context) error + func (s *MessageStore) Fetch(ctx context.Context, limit int) ([]outbox.Message, error) + func (s *MessageStore) MarkPublished(ctx context.Context, messageIDs []string) error + func (s *MessageStore) PurgePublished(ctx context.Context, olderThan time.Duration) error + func (s *MessageStore) Save(ctx context.Context, message outbox.Message) error + func (s *MessageStore) Send(ctx context.Context, channel string, message msg.Message) error + type MessageStoreOption func(*MessageStore) + func WithMessageStoreLogger(logger log.Logger) MessageStoreOption + func WithMessageStoreTableName(tableName string) MessageStoreOption + type SagaInstanceStore struct + func NewSagaInstanceStore(client Client, options ...SagaInstanceStoreOption) *SagaInstanceStore + func (s *SagaInstanceStore) Find(ctx context.Context, sagaName, sagaID string) (*saga.Instance, error) + func (s *SagaInstanceStore) Save(ctx context.Context, sagaInstance *saga.Instance) error + func (s *SagaInstanceStore) Update(ctx context.Context, sagaInstance *saga.Instance) error + type SagaInstanceStoreOption func(*SagaInstanceStore) + func WithSagaInstanceStoreLogger(logger log.Logger) SagaInstanceStoreOption + func WithSagaInstanceStoreTableName(tableName string) SagaInstanceStoreOption + type SnapshotStore struct + func (s *SnapshotStore) Load(ctx context.Context, root *es.AggregateRoot) error + func (s *SnapshotStore) Save(ctx context.Context, root *es.AggregateRoot) error + type SnapshotStoreOption func(*SnapshotStore) + func WithSnapshotStoreLogger(logger log.Logger) SnapshotStoreOption + func WithSnapshotStoreStrategy(strategy es.SnapshotStrategy) SnapshotStoreOption + func WithSnapshotStoreTableName(tableName string) SnapshotStoreOption