eventstore_db

package
v0.0.0-...-42841ab Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2022 License: MIT Imports: 25 Imported by: 6

Documentation

Index

Constants

View Source
const (
	NoESDB = "No ESDB"
)
View Source
const (
	ProjectorFmt = "eventstoreDB.Projector"
)

Variables

View Source
var (
	ErrNoESDB = fmt.Errorf(NoESDB)
)

Functions

func AddESProjector

func AddESProjector(ioc ioc.IDig) ioc.IDig

func BehaviorStore

func BehaviorStore(log logger.IAppLogger, newDb EventStoreDBFtor) comps.BehaviorStoreFtor

BehaviorStore is an Injection that injects a functor for IBehaviorStore

func EventProjector

func EventProjector(newClient EventStoreDBFtor) comps.IProjector

EventProjector is a Projector that marshals events onto the Mediator

func EventSourcing

func EventSourcing(cfgPath config.Path) ioc.IDig

func EventStore

func EventStore(log logger.IAppLogger, newClient EventStoreDBFtor) comps.EventStoreFtor

func EvtProjFtor

func EvtProjFtor(newClient EventStoreDBFtor) comps.ProjectorFtor

EvtProjFtor is a functor for Projectors that marshal events onto the Mediator where they can be handled by all kinds of GenProjection Handlers.

Types

type EventStoreDBFtor

type EventStoreDBFtor func() *esdb.Client

EventStoreDBFtor is a functor that returns an EventStoreDB client

func SingletonESClient

func SingletonESClient(cfg config.IAppConfig) EventStoreDBFtor

SingletonESClient is an injection that returns an EventStoreDB functor

func TransientESClient

func TransientESClient(cfg config.IAppConfig) EventStoreDBFtor

TransientESClient returns a functor that creates a transient EventStoreDB client

type IESDB

type IESDB interface {
	Close() error
	AppendToStream(
		context context.Context,
		streamID string,
		opts esdb.AppendToStreamOptions,
		events ...esdb.EventData,
	) (*esdb.WriteResult, error)
	SetStreamMetadata(
		context context.Context,
		streamID string,
		opts esdb.AppendToStreamOptions,
		metadata esdb.StreamMetadata,
	) (*esdb.WriteResult, error)
	GetStreamMetadata(
		context context.Context,
		streamID string,
		opts esdb.ReadStreamOptions,
	) (*esdb.StreamMetadata, error)
	DeleteStream(
		parent context.Context,
		streamID string,
		opts esdb.DeleteStreamOptions,
	) (*esdb.DeleteResult, error)
	TombstoneStream(
		parent context.Context,
		streamID string,
		opts esdb.TombstoneStreamOptions,
	) (*esdb.DeleteResult, error)
	ReadStream(
		context context.Context,
		streamID string,
		opts esdb.ReadStreamOptions,
		count uint64,
	) (*esdb.ReadStream, error)
	ReadAll(
		context context.Context,
		opts esdb.ReadAllOptions,
		count uint64,
	) (*esdb.ReadStream, error)
	SubscribeToStream(
		parent context.Context,
		streamID string,
		opts esdb.SubscribeToStreamOptions,
	) (*esdb.Subscription, error)
	SubscribeToAll(
		parent context.Context,
		opts esdb.SubscribeToAllOptions,
	) (*esdb.Subscription, error)
	SubscribeToPersistentSubscription(
		ctx context.Context,
		streamName string,
		groupName string,
		options esdb.SubscribeToPersistentSubscriptionOptions,
	) (*esdb.PersistentSubscription, error)
	SubscribeToPersistentSubscriptionToAll(
		ctx context.Context,
		groupName string,
		options esdb.SubscribeToPersistentSubscriptionOptions,
	) (*esdb.PersistentSubscription, error)
	CreatePersistentSubscription(
		ctx context.Context,
		streamName string,
		groupName string,
		options esdb.PersistentStreamSubscriptionOptions,
	) error
	CreatePersistentSubscriptionToAll(
		ctx context.Context,
		groupName string,
		options esdb.PersistentAllSubscriptionOptions,
	) error
	UpdatePersistentSubscription(
		ctx context.Context,
		streamName string,
		groupName string,
		options esdb.PersistentStreamSubscriptionOptions,
	) error
	UpdatePersistentSubscriptionToAll(
		ctx context.Context,
		groupName string,
		options esdb.PersistentAllSubscriptionOptions,
	) error
	DeletePersistentSubscription(
		ctx context.Context,
		streamName string,
		groupName string,
		options esdb.DeletePersistentSubscriptionOptions,
	) error
	DeletePersistentSubscriptionToAll(
		ctx context.Context,
		groupName string,
		options esdb.DeletePersistentSubscriptionOptions,
	) error
	ReplayParkedMessages(
		ctx context.Context,
		streamName string,
		groupName string,
		options esdb.ReplayParkedMessagesOptions) error
	ReplayParkedMessagesToAll(ctx context.Context, groupName string, options esdb.ReplayParkedMessagesOptions) error
	ListAllPersistentSubscriptions(ctx context.Context, options esdb.ListPersistentSubscriptionsOptions) ([]esdb.PersistentSubscriptionInfo, error)
	ListPersistentSubscriptionsForStream(ctx context.Context, streamName string, options esdb.ListPersistentSubscriptionsOptions) ([]esdb.PersistentSubscriptionInfo, error)
	ListPersistentSubscriptionsToAll(ctx context.Context, options esdb.ListPersistentSubscriptionsOptions) ([]esdb.PersistentSubscriptionInfo, error)
	GetPersistentSubscriptionInfo(ctx context.Context, streamName string, groupName string, options esdb.GetPersistentSubscriptionOptions) (*esdb.PersistentSubscriptionInfo, error)
	GetPersistentSubscriptionInfoToAll(ctx context.Context, groupName string, options esdb.GetPersistentSubscriptionOptions) (*esdb.PersistentSubscriptionInfo, error)
	RestartPersistentSubscriptionSubsystem(ctx context.Context, options esdb.RestartPersistentSubscriptionSubsystemOptions) error
}

type Logger

type Logger interface {
	logger.IAppLogger
	ProjectionEvent(projectionName string, groupName string, event *esdb.ResolvedEvent, workerID int)
}

type ProjectionWorkerFunc

type ProjectionWorkerFunc func(ctx context.Context, stream *esdb.PersistentSubscription, workerID int) error

type ProjectorName

type ProjectorName string

type SubscriptionGroupName

type SubscriptionGroupName string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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