Documentation
¶
Overview ¶
Package time provides time constraints for queries.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Constraints ¶
type Constraints interface {
// Exact returns the exact times to query for.
Exact() []time.Time
// Ranges returns the time ranges to query for.
Ranges() []Range
// Min returns the minimum allowed time to query for. Zero time means this
// filter is disabled
Min() time.Time
// Max returns the maximum allowed time to query for. Zero time means this
// filter is disabled
Max() time.Time
}
Constraints are the time constraints for an event query. Methods of Constraints that return non-nil filters must all be fulfilled by an event to be included in the query result. If a filter allows multiple values, the event must match at least one of the values.
func Filter ¶
func Filter(opts ...Option) Constraints
Filter returns Constraints from the given Constraint opts.
func Merge ¶
func Merge(constraints ...Constraints) Constraints
Merge merges the provided Constraints into one.
type Option ¶
type Option func(*constraints)
A Option defines a time constraint.
func DryMerge ¶
func DryMerge(constraints ...Constraints) []Option
DryMerge returns the Options to merge the provided Constraints.
Click to show internal directories.
Click to hide internal directories.