Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EventQueryOpts ¶
EventQueryOpts returns query.Options for a given aggregate.Query.
In order for the returned Query to return the correct events, EventQueryOpts needs to rewrite some of the version filters to make sense for an aggregate- specific event.Query:
- version.Exact is rewritten to version.Max (querying for version 10 of an aggregate should return events 1 -> 10)
- version.Max is passed without modification
- version.Min is discarded (because an aggregate cannot start at a version > 1)
- version.Ranges is rewritten to version.Max
Types ¶
type Option ¶
type Option func(*builder)
Option is a query option.
func SortBy ¶
func SortBy(sort aggregate.Sorting, dir aggregate.SortDirection) Option
SortBy returns an Option that defines the sorting behaviour for a Query.
func SortByMulti ¶
func SortByMulti(sorts ...aggregate.SortOptions) Option
SortByMulti returns an Option that defines the sorting behaviour for a Query.
type Query ¶
type Query struct {
// contains filtered or unexported fields
}
Query is used by aggregate repositories to filter aggregates.
func (Query) Sortings ¶
func (q Query) Sortings() []aggregate.SortOptions
Sortings returns the SortConfig for the query.
func (Query) Versions ¶
func (q Query) Versions() version.Constraints
Versions returns the aggregate version constraints for the query.
Click to show internal directories.
Click to hide internal directories.