Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type AggregateReducer ¶
type AggregateReducer struct { Aggregate eventstore.AggregateType EventRedusers []EventReducer }
EventReducer represents the required data to work with aggregates
type Column ¶
func NewJSONCol ¶
type EventReducer ¶
type EventReducer struct { Event eventstore.EventType Reduce Reduce }
EventReducer represents the required data to work with events
type Handler ¶
type Handler struct { Eventstore *eventstore.Eventstore Sub *eventstore.Subscription EventQueue chan eventstore.Event }
func NewHandler ¶
func NewHandler(config HandlerConfig) Handler
func (*Handler) Subscribe ¶
func (h *Handler) Subscribe(aggregates ...eventstore.AggregateType)
func (*Handler) SubscribeEvents ¶
func (h *Handler) SubscribeEvents(types map[eventstore.AggregateType][]eventstore.EventType)
type HandlerConfig ¶
type HandlerConfig struct {
Eventstore *eventstore.Eventstore
}
type ProjectionHandler ¶
type ProjectionHandler struct { Handler ProjectionName string // contains filtered or unexported fields }
func NewProjectionHandler ¶
func NewProjectionHandler( config ProjectionHandlerConfig, reduce Reduce, update Update, query SearchQuery, ) *ProjectionHandler
func (*ProjectionHandler) Process ¶
func (h *ProjectionHandler) Process( ctx context.Context, reduce Reduce, update Update, lock Lock, unlock Unlock, )
Process waits for several conditions: if context is canceled the function gracefully shuts down if an event occures it reduces the event if the internal timer expires the handler will check for unprocessed events on eventstore
func (*ProjectionHandler) ResetShouldBulk ¶
func (h *ProjectionHandler) ResetShouldBulk()
func (*ProjectionHandler) TriggerBulk ¶ added in v1.84.4
type ProjectionHandlerConfig ¶
type Reduce ¶
type Reduce func(eventstore.Event) (*Statement, error)
Reduce reduces the given event to a statement which is used to update the projection
type SearchQuery ¶
type SearchQuery func() (query *eventstore.SearchQueryBuilder, queryLimit uint64, err error)
SearchQuery generates the search query to lookup for events
type Statement ¶
type Statement struct { AggregateType eventstore.AggregateType Sequence uint64 PreviousSequence uint64 Execute func(ex Executer, projectionName string) error }
type Statements ¶
type Statements []Statement
func (Statements) Len ¶
func (stmts Statements) Len() int
func (Statements) Less ¶
func (stmts Statements) Less(i, j int) bool
func (Statements) Swap ¶
func (stmts Statements) Swap(i, j int)
Click to show internal directories.
Click to hide internal directories.