Documentation
¶
Index ¶
- type TemporalExtent
- type TimeInterval
- func (t *TimeInterval) Equal(other *TimeInterval) bool
- func (t *TimeInterval) String() string
- func (t *TimeInterval) ToHalfOpen() *TimeInterval
- func (t *TimeInterval) ToProtoDatapointInterval() *datasetsv1.DatapointInterval
- func (t *TimeInterval) ToProtoIDInterval() *workflowsv1.IDInterval
- func (t *TimeInterval) ToProtoTimeInterval() *datasetsv1.TimeInterval
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TemporalExtent ¶
type TemporalExtent interface { ToProtoTimeInterval() *datasetsv1.TimeInterval ToProtoDatapointInterval() *datasetsv1.DatapointInterval ToProtoIDInterval() *workflowsv1.IDInterval }
TemporalExtent is an interface for querying resources and filtering them by a time range.
type TimeInterval ¶
type TimeInterval struct { // Start is the start time of the interval. Start time.Time // End is the end time of the interval. End time.Time // We use exclusive for Start and inclusive for End, because that way when both are false, // we have a half-open interval [Start, End) which is the default behavior we want to achieve. StartExclusive bool EndInclusive bool }
TimeInterval represents a time interval.
Both the Start and End time can be exclusive or inclusive.
func NewEmptyTimeInterval ¶
func NewEmptyTimeInterval() *TimeInterval
func NewPointInTime ¶
func NewPointInTime(t time.Time) *TimeInterval
NewPointInTime creates a new TimeInterval that represents a single point in time.
func NewTimeInterval ¶
func NewTimeInterval(start, end time.Time) *TimeInterval
NewTimeInterval creates a new half-open TimeInterval which includes the start time but excludes the end time. In case you want to control the inclusivity of the start and end time, consider instantiating a TimeInterval struct directly.
func ProtoToTimeInterval ¶
func ProtoToTimeInterval(t *datasetsv1.TimeInterval) *TimeInterval
func (*TimeInterval) Equal ¶
func (t *TimeInterval) Equal(other *TimeInterval) bool
func (*TimeInterval) String ¶
func (t *TimeInterval) String() string
func (*TimeInterval) ToHalfOpen ¶
func (t *TimeInterval) ToHalfOpen() *TimeInterval
ToHalfOpen converts the TimeInterval to a half-open interval [Start, End).
func (*TimeInterval) ToProtoDatapointInterval ¶
func (t *TimeInterval) ToProtoDatapointInterval() *datasetsv1.DatapointInterval
func (*TimeInterval) ToProtoIDInterval ¶
func (t *TimeInterval) ToProtoIDInterval() *workflowsv1.IDInterval
func (*TimeInterval) ToProtoTimeInterval ¶
func (t *TimeInterval) ToProtoTimeInterval() *datasetsv1.TimeInterval
Click to show internal directories.
Click to hide internal directories.