Documentation
¶
Index ¶
- Constants
- type Bounds
- func (b Bounds) Contains(t values.Time) bool
- func (b Bounds) Equal(o Bounds) bool
- func (b Bounds) Intersect(o Bounds) Bounds
- func (b Bounds) IsEmpty() bool
- func (b Bounds) IsZero() bool
- func (b Bounds) Length() values.Duration
- func (b Bounds) Overlaps(o Bounds) bool
- func (b Bounds) Start() values.Time
- func (b Bounds) Stop() values.Time
- func (b Bounds) String() string
- func (b Bounds) Union(o Bounds) Bounds
- type Window
- func (w Window) Every() values.Duration
- func (w Window) GetLatestBounds(t values.Time) Bounds
- func (w Window) GetOverlappingBounds(start, stop values.Time) []Bounds
- func (w Window) IsZero() bool
- func (w Window) NextBounds(b Bounds) Bounds
- func (w Window) Period() values.Duration
- func (w Window) PrevBounds(b Bounds) Bounds
Constants ¶
const ( MaxTime = math.MaxInt64 MinTime = math.MinInt64 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bounds ¶
type Bounds struct {
// contains filtered or unexported fields
}
func (Bounds) Intersect ¶ added in v0.105.0
Intersect returns the intersection of two bounds. It returns empty bounds if one of the input bounds are empty. TODO: there are several places that implement bounds and related utilities.
consider a central place for them?
type Window ¶
type Window struct {
// contains filtered or unexported fields
}
TODO(nathanielc): Make the epoch a parameter to the window See https://github.com/influxdata/flux/issues/2093
Window is a description of an infinite set of boundaries in time.
func NewWindow ¶
NewWindow creates a window which can be used to determine the boundaries for a given point. Window boundaries start at the epoch plus the offset. Each subsequent window starts at a multiple of the every duration. Each window's length is the start boundary plus the period. Every must not be a mix of months and nanoseconds in order to preserve constant time bounds lookup.
func (Window) GetLatestBounds ¶
GetLatestBounds returns the bounds for the latest window bounds that contains the given time t. For underlapping windows that do not contain time t, the window directly before time t will be returned.
func (Window) GetOverlappingBounds ¶
GetOverlappingBounds returns a slice of bounds that overlaps the input bounds. The returned set of bounds are ordered by decreasing time.
func (Window) NextBounds ¶
NextBounds returns the next boundary in sequence from the given boundary.
func (Window) PrevBounds ¶
PrevBounds returns the previous boundary in sequence from the given boundary.