groupByFunctions

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: May 31, 2022 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Functions = map[string]GroupByFunctionMaker{
	"time-window": MakeTimeWindowFunction,
	"value":       MakeValueFunction,
}
View Source
var TimeFormatters = map[string]TimeFormatter{
	"rfc3339":    RFC3339Formatter,
	"unix":       UnixFormatter,
	"unix-nano":  UnixNanoFormatter,
	"unix-milli": UnixMilliFormatter,
}
View Source
var TimeParsers = map[string]TimeParser{
	"rfc3339":    RFC3339Parser,
	"unix":       UnixParser,
	"unix-nano":  UnixNanoParser,
	"unix-milli": UnixMilliParser,
}
View Source
var TimeWindowFunctions = map[string]TimeWindowFunction{
	"minute":       minute,
	"hour":         hour,
	"day":          day,
	"day-by-hour":  dayByHour,
	"week":         week,
	"week-by-day":  weekByDay,
	"month":        month,
	"month-by-day": monthByDay,
	"year":         year,
}

Functions

func RFC3339Formatter

func RFC3339Formatter(input int64) interface{}

func RFC3339Parser

func RFC3339Parser(input interface{}) (int64, error)

func UnixFormatter

func UnixFormatter(input int64) interface{}

func UnixMilliFormatter

func UnixMilliFormatter(input int64) interface{}

func UnixMilliParser

func UnixMilliParser(input interface{}) (int64, error)

func UnixNanoFormatter

func UnixNanoFormatter(input int64) interface{}

func UnixNanoParser

func UnixNanoParser(input interface{}) (int64, error)

func UnixParser

func UnixParser(input interface{}) (int64, error)

Types

type GroupByFunction

type GroupByFunction func(item *kodex.Item) ([]*GroupByValue, error)

func MakeTimeWindowFunction

func MakeTimeWindowFunction(config map[string]interface{}) (GroupByFunction, error)

func MakeValueFunction

func MakeValueFunction(config map[string]interface{}) (GroupByFunction, error)

type GroupByFunctionMaker

type GroupByFunctionMaker func(map[string]interface{}) (GroupByFunction, error)

type GroupByTimeWindow

type GroupByTimeWindow struct {
}

type GroupByValue

type GroupByValue struct {
	Values     map[string]interface{}
	Expiration int64
}

type TimeFormatter

type TimeFormatter func(int64) interface{}

type TimeParser

type TimeParser func(interface{}) (int64, error)

type TimeWindow

type TimeWindow struct {
	FromTime int64
	ToTime   int64
	Type     string
}

type TimeWindowFunction

type TimeWindowFunction func(int64) []*TimeWindow

Jump to

Keyboard shortcuts

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