granularity

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: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Granularity

type Granularity struct {
	time.Duration
	MaxDuration time.Duration
	Period      period.Period
	// contains filtered or unexported fields
}

Granularity string type to extend extra helper functions

var (
	//OneMin is a static def for the 1 minute granularity string
	OneMin Granularity = newGranularity("PT1M")
	//FiveMin is a static def for the 5 minute granularity string
	FiveMin Granularity = newGranularity("PT5M")
	//FifteenMin is a static def for the 15 minute granularity string
	FifteenMin Granularity = newGranularity("PT15M")
	//ThirtyMin is a static def for the 30 minute granularity string
	ThirtyMin Granularity = newGranularity("PT30M")
	//OneHour is a static def for the 1 hour granularity string
	OneHour Granularity = newGranularity("PT1H")
	//FourHours is a static def for the 4 hours granularity string
	FourHours Granularity = newGranularity("PT4H")
	//SixHours is a static def for the 6 hours granularity string
	SixHours Granularity = newGranularity("PT6H")
	//TwelveHours is a static def for the 12 hours granularity string
	TwelveHours Granularity = newGranularity("PT12H")
	//OneDay is a static def for the 1 day granularity string
	OneDay Granularity = newGranularity("P1D")
	//All is a static def for the ALL granularity string
	All Granularity = newGranularity("ALL")

	//AvailableGranularities is a collection of all available Granularities
	AvailableGranularities []Granularity = []Granularity{
		OneMin,
		FiveMin,
		FifteenMin,
		ThirtyMin,
		OneHour,
		OneDay,
		All,
	}
)

func (Granularity) Equals

func (g Granularity) Equals(gran Granularity) bool

func (Granularity) IsValid

func (g Granularity) IsValid() bool

IsValid checks in the current Granularity is a valid, available, and known Granularity

func (Granularity) MarshalJSON

func (g Granularity) MarshalJSON() ([]byte, error)

func (Granularity) String

func (g Granularity) String() string

Jump to

Keyboard shortcuts

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