common

package
v4.2.459+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	AggregationOverTime = map[AggregateFunction]string{
		MaxOverTime: "max_over_time",
	}

	TimeRange2AggregationOverTime = map[Common.TimeRange_AggregateFunction]AggregateFunction{
		Common.TimeRange_NONE: None,
		Common.TimeRange_MAX:  MaxOverTime,
	}
)
View Source
var (
	DefaultStepTime, _ = time.ParseDuration("30s")
)

Functions

This section is empty.

Types

type AggregateFunction

type AggregateFunction = int

Aggregate function enumerator

const (
	None        AggregateFunction = 0
	MaxOverTime AggregateFunction = 1
)

Aggregation function definition

type Option

type Option func(*Options)

func AggregateOverTimeFunc

func AggregateOverTimeFunc(f AggregateFunction) Option

func EndTime

func EndTime(t *time.Time) Option

func StartTime

func StartTime(t *time.Time) Option

func StepTime

func StepTime(d *time.Duration) Option

func Timeout

func Timeout(t *time.Time) Option

type Options

type Options struct {
	StartTime             *time.Time
	EndTime               *time.Time
	Timeout               *time.Time
	StepTime              *time.Duration
	AggregateOverTimeFunc AggregateFunction
}

func NewDefaultOptions

func NewDefaultOptions() Options

type Order

type Order = int

Order enumerator

const (
	// Represent ascending order
	Asc Order = 0
	// Represent descending order
	Desc Order = 1
)

Sort order definition

type QueryCondition

type QueryCondition struct {
	StartTime                 *time.Time
	EndTime                   *time.Time
	Timeout                   *time.Time
	StepTime                  *time.Duration
	TimestampOrder            Order
	Limit                     int
	AggregateOverTimeFunction AggregateFunction
}

QueryCondition Others query condition

func BuildQueryCondition

func BuildQueryCondition(condition *Common.QueryCondition) QueryCondition

func BuildQueryConditionV1

func BuildQueryConditionV1(condition *DatahubV1alpha1.QueryCondition) *QueryCondition

func NewQueryCondition added in v0.9.166

func NewQueryCondition(days, hours, seconds, steps int) *QueryCondition

Jump to

Keyboard shortcuts

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