Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EventQueryOpts ¶
EventQueryOpts returns a slice of query.Option for an aggregate.Query, converting the aggregate query's names, IDs, and version constraints into corresponding event query options.
Types ¶
type Option ¶
type Option func(*builder)
Option is a function that modifies a query builder. It allows to configure the aggregate Query by adding names, IDs, version constraints, and sorting options to the builder. Multiple Option functions can be combined to create complex queries.
func ID ¶
ID adds the specified UUIDs to the query, ensuring that only unique IDs are stored. The query will match aggregates with any of the provided IDs.
func SortBy ¶
func SortBy(sort aggregate.Sorting, dir aggregate.SortDirection) Option
SortBy sets the sorting option for the aggregate query by specifying the sort field and direction. It replaces any existing sortings with the provided one.
func SortByMulti ¶
func SortByMulti(sorts ...aggregate.SortOptions) Option
SortByMulti appends multiple aggregate.SortOptions to the sortings of a Query.
type Query ¶
type Query struct {
// contains filtered or unexported fields
}
Query is a filter for Aggregates based on their name, ID, version, and sorting options. It is used to selectively process Aggregates that match the specified criteria.
func Merge ¶
Merge combines multiple aggregate.Query instances into a single Query. It merges the names, IDs, and version constraints of the provided queries and returns a new Query with the merged options.
func New ¶
New creates a Query with the provided options. The returned Query can be used to filter aggregates based on their name, ID, version, and sorting options.
func (Query) Sortings ¶
func (q Query) Sortings() []aggregate.SortOptions
Sortings returns the sorting options of the Query. The returned sort options determine the order in which Aggregates should be sorted when processing the Query.
func (Query) Versions ¶
func (q Query) Versions() version.Constraints
Versions returns the version constraints of the Query, which are used to filter aggregates based on their versions.
type Tagger ¶
type Tagger interface { // HasTag checks if the specified tag is present in the Tagger interface. It // returns true if the tag is found, and false otherwise. HasTag(string) bool }
Tagger is an interface that provides a method to check if a specific tag is present. It is used to filter aggregates based on their tags.