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 ¶ added in v1.43.0
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.EventReader
}
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) *ProjectionHandler
func (*ProjectionHandler) Process ¶
func (h *ProjectionHandler) Process( ctx context.Context, reduce Reduce, update Update, lock Lock, unlock Unlock, query SearchQuery, )
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()
type ProjectionHandlerConfig ¶
type Reduce ¶
type Reduce func(eventstore.EventReader) (*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 ¶ added in v1.43.0
type Statements []Statement
func (Statements) Len ¶ added in v1.43.0
func (stmts Statements) Len() int
func (Statements) Less ¶ added in v1.43.0
func (stmts Statements) Less(i, j int) bool
func (Statements) Swap ¶ added in v1.43.0
func (stmts Statements) Swap(i, j int)
Click to show internal directories.
Click to hide internal directories.