mongo

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2023 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSnapshotStore

func NewSnapshotStore(collection Collection, registry registry.Registry) esourcing.AggregateStoreMiddleware

Types

type Collection

type Collection interface {
	Name() string
	Find(ctx context.Context, filter interface{}, opts ...*options.FindOptions) (cur *mongo.Cursor, err error)
	FindOne(ctx context.Context, filter interface{}, opts ...*options.FindOneOptions) *mongo.SingleResult
	InsertOne(ctx context.Context, document interface{}, opts ...*options.InsertOneOptions) (*mongo.InsertOneResult, error)
	InsertMany(ctx context.Context, documents []interface{}, opts ...*options.InsertManyOptions) (*mongo.InsertManyResult, error)
	DeleteOne(ctx context.Context, filter interface{}, opts ...*options.DeleteOptions) (*mongo.DeleteResult, error)
	DeleteMany(ctx context.Context, filter interface{}, opts ...*options.DeleteOptions) (*mongo.DeleteResult, error)
	UpdateMany(ctx context.Context, filter interface{}, update interface{}, opts ...*options.UpdateOptions) (*mongo.UpdateResult, error)
	UpdateOne(ctx context.Context, filter interface{}, update interface{}, opts ...*options.UpdateOptions) (*mongo.UpdateResult, error)
}

type EventStore

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

func NewEventStore

func NewEventStore(collectionName string, collection Collection, registry registry.Registry) EventStore

func (EventStore) Load

func (s EventStore) Load(ctx context.Context, aggregate esourcing.EventSourcedAggregate) (err error)

func (EventStore) Save

func (s EventStore) Save(ctx context.Context, aggregate esourcing.EventSourcedAggregate) (err error)

type InboxStore

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

func NewInboxStore

func NewInboxStore(collection Collection) InboxStore

func (InboxStore) Save

type OutboxStore

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

func NewOutboxStore

func NewOutboxStore(collection Collection) OutboxStore

func (OutboxStore) FindUnpublished

func (s OutboxStore) FindUnpublished(ctx context.Context, limit int) ([]async.Message, error)

func (OutboxStore) MarkPublished

func (s OutboxStore) MarkPublished(ctx context.Context, ids ...string) (err error)

func (OutboxStore) Save

func (s OutboxStore) Save(ctx context.Context, msg async.Message) error

type SagaStore

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

func NewSagaStore

func NewSagaStore(collection Collection, registry registry.Registry) *SagaStore

func (*SagaStore) Load

func (s *SagaStore) Load(ctx context.Context, sagaName, sagaID string) (*sec.SagaContext[[]byte], error)

func (*SagaStore) Save

func (s *SagaStore) Save(ctx context.Context, sagaName string, sagaCtx *sec.SagaContext[[]byte]) error

type SnapshotStore

type SnapshotStore struct {
	esourcing.AggregateStore
	// contains filtered or unexported fields
}

func (SnapshotStore) Load

func (SnapshotStore) Save

Jump to

Keyboard shortcuts

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