window

package
v0.0.0-...-290ccf9 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SESSION = iota + 1
	STATE
	INTERVAL
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Duration

type Duration struct {
	Value uint64
	Unit  UnitType
}

func NewDurationFromTimeDuration

func NewDurationFromTimeDuration(duration time.Duration) (*Duration, error)

func ParseDuration

func ParseDuration(durationString string) (*Duration, error)

type UnitType

type UnitType string
const (
	Microsecond UnitType = "u"
	Millisecond UnitType = "a"
	Second      UnitType = "s"
	Minute      UnitType = "m"
	Hour        UnitType = "h"
	Day         UnitType = "d"
	Week        UnitType = "w"
	Month       UnitType = "n"
	Year        UnitType = "y"
)

u(微秒)、a(毫秒)、s(秒)、m(分)、h(小时)、d(天)、w(周) n(自然月) 和 y(自然年)

type Window

type Window struct {
	// contains filtered or unexported fields
}

func SetInterval

func SetInterval(duration Duration) Window

SetInterval create an interval window [INTERVAL(interval_val [, interval_offset]) [SLIDING sliding_val]]

func SetSessionWindow

func SetSessionWindow(tsColumn string, duration Duration) Window

SetSessionWindow create a session window [SESSION(ts_col, tol_val)]

func SetStateWindow

func SetStateWindow(column string) Window

SetStateWindow create a state window [STATE_WINDOW(col)]

func (Window) Build

func (sc Window) Build(builder clause.Builder)

func (Window) MergeClause

func (sc Window) MergeClause(c *clause.Clause)

func (Window) Name

func (sc Window) Name() string

func (Window) SetOffset

func (sc Window) SetOffset(offset Duration) Window

SetOffset set offset to interval window

func (Window) SetSliding

func (sc Window) SetSliding(sliding Duration) Window

SetSliding set sliding to interval window

Jump to

Keyboard shortcuts

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