interval

package
v0.0.0-...-1825ddb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 29, 2021 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Interval

type Interval struct {
	timespan.TimeSpan
	// contains filtered or unexported fields
}

func Between

func Between(start, end time.Time) Interval

func EndingAt

func EndingAt(duration time.Duration, end time.Time) Interval

func Of

func Of(intervals ...Interval) []Interval

func Parse

func Parse(value string) (Interval, error)

func StartingFrom

func StartingFrom(start time.Time, duration time.Duration) Interval

func (Interval) IsValidGranularity

func (i Interval) IsValidGranularity(g granularity.Granularity) bool

IsValidInterval Checks if a Grandularity is valid for a given Interval of time. Granularities have a max on how big of an internval they can be paired with.

func (Interval) MarshalJSON

func (i Interval) MarshalJSON() ([]byte, error)

func (Interval) MinGranularity

func (i Interval) MinGranularity() granularity.Granularity

func (Interval) String

func (i Interval) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL