fn

package
v1.5.2 Latest Latest
Warning

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

Go to latest
Published: May 30, 2025 License: Apache-2.0 Imports: 8 Imported by: 4

Documentation

Index

Constants

View Source
const (
	// Math.
	AbsFunctionName   = "ABS"
	CeilFunctionName  = "CEIL"
	FloorFunctionName = "FLOOR"
	RoundFunctionName = "ROUND"
	SqrtFunctionName  = "SQRT"
	LogFunctionName   = "LOG"
	Log10FunctionName = "LOG10"
	ExpFunctionName   = "EXP"
	PowerFunctionName = "POWER"
	ModFunctionName   = "MOD"
	SinFunctionName   = "SIN"
	CosFunctionName   = "COS"
	TanFunctionName   = "TAN"
	RandFunctionName  = "RAND"
	PiFunctionName    = "PI"
	// String.
	UpperFunctionName = "UPPER"
	LowerFunctionName = "LOWER"
	TrimFunctionName  = "TRIM"
	// Time.
	CurrentTimestampFunctionName = "CURRENT_TIMESTAMP"
	NowFunctionName              = "NOW"
	// Aggregate.
	MaxFunctionName   = "MAX"
	MinFunctionName   = "MIN"
	SumFunctionName   = "SUM"
	AvgFunctionName   = "AVG"
	CountFunctionName = "COUNT"
	// Airthmetic.
	AddOperatorID = "+"
	SubOperatorID = "-"
	MulOperatorID = "*"
	DivOperatorID = "/"
	ModOperatorID = "%"
)
View Source
const (
	// Asterisk is a asterisk string.
	Asterisk = "*"
)

Variables

View Source
var ErrInvalid = errors.New("invalid")

ErrInvalid is returned when the value is invalid.

View Source
var ErrNegativeValue = errors.New("negative value")

ErrNegativeValue is returned when the value is negative.

View Source
var ErrNoData = errors.New("no data")

ErrNoData is returned when there is no data.

View Source
var ErrNotFound = errors.New("not found")

ErrNotFound is returned when the data type is invalid.

View Source
var ErrNotImplemented = errors.New("not implemented")

ErrNotImplemented is returned when the function is not implemented.

View Source
var ErrNotSupported = errors.New("not supported")

ErrNotSupported is returned when the function is not supported.

Functions

func ExecuteFunction

func ExecuteFunction(name string, v any) (any, error)

ExecuteFunction returns the executed value with the specified arguments.

func IsRegisteredFunction

func IsRegisteredFunction(name string) bool

IsRegisteredFunctionNamePattern checks if the given name matches any registered function name pattern.

func NewStringFunctionWith

func NewStringFunctionWith(name string, t StringFunc, opts ...ExecutorOption) *stringFunction

NewStringFunctionWith returns a new string function with the specified name and executor.

func NewTimeFunctionWith

func NewTimeFunctionWith(name string, t TimeFunc, opts ...ExecutorOption) *timeFunction

NewTimeFunctionWith returns a new time function with the specified name and executor.

func RegisteredFunctionNames

func RegisteredFunctionNames() []string

RegisteredFunctionNames returns a list of all registered function names.

func WithColumns

func WithColumns(columns []string) resultSetOption

WithColumns sets the columns of the result set.

func WithRows

func WithRows(rows []Row) resultSetOption

WithRows sets the rows of the result set.

Types

type AggrAggregateFunc

type AggrAggregateFunc func(aggr *aggrImpl, accumulatedValue float64, inputValue float64) (float64, error)

AggrAggregateFunc is a function that performs aggregation on the given values.

type AggrFinalizeFunc

type AggrFinalizeFunc func(aggr *aggrImpl, accumulatedValue float64, accumulatedCount int) (any, error)

AggrFinalizeFunc is a function that finalizes the aggregation and returns the result.

type AggrResetFunc

type AggrResetFunc func(aggr *aggrImpl) (float64, error)

AggrResetFunc is a function that resets the aggregation state.

type Aggregator

type Aggregator interface {
	// Name returns the name of the aggregator.
	Name() string
	// Type returns the type of the aggregator.
	Type() FunctionType
	// Argmuents returns the arguments of the aggregator.
	Arguments() []string
	// GroupBy returns the group by column name and whether it is a group by column.
	GroupBy() (string, bool)
	// Reset resets the aggregator to its initial state.
	Reset(opts ...any) error
	// Aggregate aggregates a map or an array. The map represents a row of data, and the array is a
	// list of rows. If grouping is enabled, the array row must have a group value as the first element.
	Aggregate(v any) error
	// Finalize finalizes the aggregation and returns the result.
	Finalize() (ResultSet, error)
}

Aggregator is an interface for aggregating data.

func NewAggregatorForName

func NewAggregatorForName(name string, opts ...AggregatorOption) (Aggregator, error)

NewAggregator creates a new Aggregator with the given options.

type AggregatorOption

type AggregatorOption = aggrOption

AggregatorOption is a function that configures the Aggregator.

func WithAggregatorArguments

func WithAggregatorArguments(args []string) AggregatorOption

WithaggregatorArguments is an option to set the arguments for the aggregator.

func WithAggregatorGroupBy

func WithAggregatorGroupBy(group string) AggregatorOption

WithAggregatorGroupBy is an option to set the group by clause for the aggregator.

func WithAggregatorName

func WithAggregatorName(name string) AggregatorOption

WithAggregatorName is an option to set the name of the aggregator.

type AggregatorSet

type AggregatorSet []Aggregator

AggregatorSet is a collection of Aggregators. It provides methods to manage and operate on multiple aggregators.

func NewAggregatorSetForNames

func NewAggregatorSetForNames(names []string, opts ...aggrOption) (AggregatorSet, error)

NewAggregatorSetForNames creates a new AggregatorSet for the given names.

func NewAggregatorSetWith

func NewAggregatorSetWith(aggrs []Aggregator) AggregatorSet

NewAggregatorSet creates a new AggregatorSet with the given aggregators.

func (*AggregatorSet) Aggregate

func (aggrSet *AggregatorSet) Aggregate(v any) error

Aggregate aggregates a row of data using all aggregators in the set.

func (*AggregatorSet) Finalize

func (aggrSet *AggregatorSet) Finalize() (ResultSet, error)

Finalize finalizes the aggregation and returns the result set.

func (*AggregatorSet) Reset

func (aggrSet *AggregatorSet) Reset(opts ...any) error

Reset resets all aggregators in the set.

type Argument

type Argument string

Argument represents am argument in a function.

func NewArgumentWith

func NewArgumentWith(arg string) Argument

NewArgument returns a new argument instance from the specified string.

func (Argument) IsAsterisk

func (arg Argument) IsAsterisk() bool

IsAsterisk returns true whether the argument name is the asterisk.

func (Argument) IsName

func (arg Argument) IsName(name string) bool

IsName returns true whether the argument name is the specified one.

func (Argument) Name

func (arg Argument) Name() string

Name returns the name of the argument.

func (Argument) String

func (arg Argument) String() string

String returns the string representation of the argument.

type Arguments

type Arguments []Argument

Arguments represens an argument array in a function.

func NewArgumentStrings

func NewArgumentStrings(strs ...string) Arguments

NewArgumentStrings returns an argument array instance with the specified string arguments.

func NewArguments

func NewArguments() Arguments

NewArguments returns an empty argument array instance.

func NewArgumentsWith

func NewArgumentsWith(args ...Argument) Arguments

NewArgumentsWith returns an argument array instance with the specified arguments.

func (Arguments) IsAsterisk

func (args Arguments) IsAsterisk() bool

IsAsterisk returns true if the argument list is an asterisk.

func (Arguments) Names

func (args Arguments) Names() []string

Name returns the name of the first argument in the list.

func (Arguments) String

func (args Arguments) String() string

String returns a string representation of the the argument list.

type ArithFunc

type ArithFunc func(float64, float64) (float64, error)

ArithFunc represents an arithmetic function.

type Avg

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

Avg is an aggregator that calculates the average of values.

func NewAvg

func NewAvg(opts ...AvgOption) (*Avg, error)

NewAvg creates a new Avg aggregator with the given options.

func (Avg) Aggregate

func (aggr Avg) Aggregate(v any) error

Aggregate aggregates a map or an array. The map represents a row of data, and the array is a list of rows. If grouping is enabled, the array row must have a group value as the first element.

func (Avg) AggregateMap

func (aggr Avg) AggregateMap(m map[string]any) error

AggregateMap aggregates a map of data using the aggregator.

func (Avg) AggregateRow

func (aggr Avg) AggregateRow(row []any) error

AggregateRow aggregates a row of data using the aggregator. The row is expected to be an array where the first element is the group value (if grouping is enabled),

func (Avg) Arguments

func (aggr Avg) Arguments() []string

Arguments returns the arguments of the aggregator.

func (Avg) Finalize

func (aggr Avg) Finalize() (ResultSet, error)

Finalize finalizes the aggregation and returns the result.

func (Avg) GroupBy

func (aggr Avg) GroupBy() (string, bool)

GroupBy returns the group by column name and a boolean indicating if it is set.

func (Avg) Name

func (aggr Avg) Name() string

Name returns the name of the aggregator.

func (Avg) Reset

func (aggr Avg) Reset(opts ...any) error

Reset resets the aggregator to its initial state.

func (Avg) Type

func (aggrImpl Avg) Type() FunctionType

Type returns the type of the aggregator.

type AvgOption

type AvgOption = aggrOption

AvgOption is a function that configures the Avg aggregator.

func WithAvgArguments

func WithAvgArguments(args []string) AvgOption

WithAvgArguments sets the arguments for the Avg aggregator.

func WithAvgGroupBy

func WithAvgGroupBy(group string) AvgOption

WithAvgGroupBy sets the group by column for the Avg aggregator.

type CastFunc

type CastFunc = func(any) (any, error)

CastFunc returns the latest aggregated value.

type Count

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

Count is an aggregator that calculates the sum of values.

func NewCount

func NewCount(opts ...CountOption) (*Count, error)

NewCount creates a new Count aggregator with the given options.

func (Count) Aggregate

func (aggr Count) Aggregate(v any) error

Aggregate aggregates a map or an array. The map represents a row of data, and the array is a list of rows. If grouping is enabled, the array row must have a group value as the first element.

func (Count) AggregateMap

func (aggr Count) AggregateMap(m map[string]any) error

AggregateMap aggregates a map of data using the aggregator.

func (Count) AggregateRow

func (aggr Count) AggregateRow(row []any) error

AggregateRow aggregates a row of data using the aggregator. The row is expected to be an array where the first element is the group value (if grouping is enabled),

func (Count) Arguments

func (aggr Count) Arguments() []string

Arguments returns the arguments of the aggregator.

func (Count) Finalize

func (aggr Count) Finalize() (ResultSet, error)

Finalize finalizes the aggregation and returns the result.

func (Count) GroupBy

func (aggr Count) GroupBy() (string, bool)

GroupBy returns the group by column name and a boolean indicating if it is set.

func (Count) Name

func (aggr Count) Name() string

Name returns the name of the aggregator.

func (Count) Reset

func (aggr Count) Reset(opts ...any) error

Reset resets the aggregator to its initial state.

func (Count) Type

func (aggrImpl Count) Type() FunctionType

Type returns the type of the aggregator.

type CountOption

type CountOption = aggrOption

CountOption is a function that configures the Count aggregator.

func WithCountArguments

func WithCountArguments(args []string) CountOption

WithCountArguments sets the arguments for the Count aggregator.

func WithCountGroupBy

func WithCountGroupBy(group string) CountOption

WithCountGroupBy sets the group by column for the Count aggregator.

type Executor

type Executor interface {
	// Name returns the name of the function.
	Name() string
	// Type returns the type of the function.
	Type() FunctionType
	// Arguments returns the arguments of the executor.
	Arguments() []string
	// Execute returns the executed value with the specified arguments.
	Execute(any) (any, error)
}

Executor represents a function executor interface.

func NewAbs

func NewAbs(opts ...ExecutorOption) Executor

NewAbs returns a new abs function.

func NewAddOperator

func NewAddOperator(opts ...ExecutorOption) Executor

NewAddOperator returns a new add function.

func NewArithFunctionWith

func NewArithFunctionWith(name string, arithFn ArithFunc, opts ...ExecutorOption) Executor

NewArithFunctionWith returns a new base arithmetic function with the specified name and arithmetic.

func NewArithOperatorFor

func NewArithOperatorFor(ope string, opts ...ExecutorOption) (Executor, error)

NewArithOperatorFor returns a new arithmetic function with the given operator and implementation.

func NewCastFunctionWith

func NewCastFunctionWith(name string, castFn CastFunc) Executor

NewCastFunctionWith returns a new base cast function with the specified name and cast.

func NewCeil

func NewCeil(opts ...ExecutorOption) Executor

NewCeil returns a new ceil function.

func NewCos

func NewCos(opts ...ExecutorOption) Executor

NewCos returns a new cos function.

func NewCurrentTimestamp

func NewCurrentTimestamp(opts ...ExecutorOption) Executor

NewCurrentTimestamp returns a new current timestamp function.

func NewDivOperator

func NewDivOperator(opts ...ExecutorOption) Executor

NewDivOperator returns a new division function.

func NewExecutorForName

func NewExecutorForName(name string, opts ...ExecutorOption) (Executor, error)

NewExecutorForName returns a function executor with the specified name.

func NewExp

func NewExp(opts ...ExecutorOption) Executor

NewExp returns a new exp function.

func NewFloor

func NewFloor(opts ...ExecutorOption) Executor

NewFloor returns a new floor function.

func NewLog

func NewLog(opts ...ExecutorOption) Executor

NewLog returns a new log function.

func NewLog10

func NewLog10(opts ...ExecutorOption) Executor

NewLog10 returns a new log10 function.

func NewLower

func NewLower(opts ...ExecutorOption) Executor

NewLowerFunctionWith returns a new string function with the specified name and executor.

func NewMathFunctionWith

func NewMathFunctionWith(name string, mathFn MathFunc, opts ...ExecutorOption) Executor

NewMathFunctionWith returns a new base math function with the specified name and math.

func NewMod

func NewMod(opts ...ExecutorOption) Executor

NewMod returns a new mod function.

func NewModOperator

func NewModOperator(opts ...ExecutorOption) Executor

NewModOperator returns a new mod function.

func NewMulOperator

func NewMulOperator(opts ...ExecutorOption) Executor

NewMulOperator returns a new multiple function.

func NewNow

func NewNow(opts ...ExecutorOption) Executor

NewTimeFunctionWith returns a new time function with the specified name and executor.

func NewPI

func NewPI(opts ...ExecutorOption) Executor

NewPI returns a new pi function that returns the value of π (pi).

func NewPower

func NewPower(opts ...ExecutorOption) Executor

NewPower returns a new power function.

func NewRand

func NewRand(opts ...ExecutorOption) Executor

NewRand returns a new rand function that generates a random float64 in [0.0, 1.0).

func NewRound

func NewRound(opts ...ExecutorOption) Executor

NewRound returns a new round function.

func NewSin

func NewSin(opts ...ExecutorOption) Executor

NewSin returns a new sin function.

func NewSqrt

func NewSqrt(opts ...ExecutorOption) Executor

NewSqrt returns a new sqrt function.

func NewSubOperator

func NewSubOperator(opts ...ExecutorOption) Executor

NewSubOperator returns a new sub function.

func NewTan

func NewTan(opts ...ExecutorOption) Executor

NewTan returns a new tan function.

func NewTrim

func NewTrim(opts ...ExecutorOption) Executor

NewTrimFunctionWith returns a new string function with the specified name and executor.

func NewUpper

func NewUpper(opts ...ExecutorOption) Executor

NewUpperFunctionWith returns a new string function with the specified name and executor.

type ExecutorOption

type ExecutorOption = execOption

ExecutorOption is an option for the function executor.

func WithExecutorArguments

func WithExecutorArguments(args []string) ExecutorOption

WithExecutorArguments returns an option to set the arguments for the executor.

func WithExecutorName

func WithExecutorName(name string) ExecutorOption

WithExecutorName returns an option to set the name of the executor.

type Function

type Function interface {
	// Name returns the function name.
	Name() string
	// IsName returns true whether the function name is the specified one.
	IsName(string) bool
	// Type returns the function type.
	Type() FunctionType
	// IsType returns true whether the function type is the specified one.
	IsType(FunctionType) bool
	// IsFunction returns true whether the function is a function.
	IsFunction() bool
	// Function returns the function if the function is a function.
	Function() (Function, bool)
	// Arguments returns the argument list.
	Arguments() Arguments
	// Executor returns the executor of the function.
	Executor(opts ...ExecutorOption) (Executor, error)
	// IsAggregator returns true if the function is an aggregator function.
	IsAggregator() bool
	// Aggregator returns the aggregator of the function.
	Aggregator(opts ...AggregatorOption) (Aggregator, error)
	// String returns a string representation of the function.
	String() string
	// SelectorHelper provides additional methods for selectors.
	SelectorHelper
}

Function represents a .

func NewFunctionWith

func NewFunctionWith(opts ...FunctionOption) Function

NewFunctionWith returns a function instance.

type FunctionOption

type FunctionOption = func(*function)

FunctionOption represents a function option function.

func WithFunctionAggregator

func WithFunctionAggregator(aggregator Aggregator) FunctionOption

WithFunctionAggregator sets the function aggregator.

func WithFunctionArguments

func WithFunctionArguments(args ...Argument) FunctionOption

WithFunctionArguments sets the function arguments.

func WithFunctionExecutor

func WithFunctionExecutor(executor Executor) FunctionOption

WithFunctionExecutor sets the function executor.

func WithFunctionName

func WithFunctionName(name string) FunctionOption

WithFunctionName sets the function name.

func WithFunctionType

func WithFunctionType(t FunctionType) FunctionOption

WithFunctionType sets the function type.

type FunctionType

type FunctionType int

FunctionType represents a function type.

const (
	UnknownFunctionType FunctionType = iota
	MathFunction
	AggregateFunction
	CastFunction
	ArithOperator
	TimeFunction
	StringFunction
)

func NewFunctionTypeForName

func NewFunctionTypeForName(name string) (FunctionType, error)

NewFunctionTypeForName returns a FunctionType based on the function name.

type GroupBy

type GroupBy string

GroupBy represents a group by column name.

type Map

type Map map[string]any

Map represents a map with string keys and values of any type.

func NewMapWithMap

func NewMapWithMap(m map[string]any) Map

NewMapWithMap creates a new Map from an existing map.

func NewMapWithRow

func NewMapWithRow(columns []string, row Row) Map

NewMap creates a new Map with the given key-value pairs.

type MathFunc

type MathFunc func([]float64) (any, error)

MathFunc represents an math function.

type MathResultSet

type MathResultSet map[any]float64

MathResultSet represents a result set of an math function.

type Max

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

Max is an aggregator that calculates the sum of values.

func NewMax

func NewMax(opts ...MaxOption) (*Max, error)

NewMax creates a new Max aggregator with the given options.

func (Max) Aggregate

func (aggr Max) Aggregate(v any) error

Aggregate aggregates a map or an array. The map represents a row of data, and the array is a list of rows. If grouping is enabled, the array row must have a group value as the first element.

func (Max) AggregateMap

func (aggr Max) AggregateMap(m map[string]any) error

AggregateMap aggregates a map of data using the aggregator.

func (Max) AggregateRow

func (aggr Max) AggregateRow(row []any) error

AggregateRow aggregates a row of data using the aggregator. The row is expected to be an array where the first element is the group value (if grouping is enabled),

func (Max) Arguments

func (aggr Max) Arguments() []string

Arguments returns the arguments of the aggregator.

func (Max) Finalize

func (aggr Max) Finalize() (ResultSet, error)

Finalize finalizes the aggregation and returns the result.

func (Max) GroupBy

func (aggr Max) GroupBy() (string, bool)

GroupBy returns the group by column name and a boolean indicating if it is set.

func (Max) Name

func (aggr Max) Name() string

Name returns the name of the aggregator.

func (Max) Reset

func (aggr Max) Reset(opts ...any) error

Reset resets the aggregator to its initial state.

func (Max) Type

func (aggrImpl Max) Type() FunctionType

Type returns the type of the aggregator.

type MaxOption

type MaxOption = aggrOption

MaxOption is a function that configures the Max aggregator.

func WithMaxArguments

func WithMaxArguments(args []string) MaxOption

WithMaxArguments sets the arguments for the Max aggregator.

func WithMaxGroupBy

func WithMaxGroupBy(group string) MaxOption

WithMaxGroupBy sets the group by column for the Max aggregator.

type Min

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

Min is an aggregator that calculates the minimum of values.

func NewMin

func NewMin(opts ...MinOption) (*Min, error)

NewMin creates a new Min aggregator with the given options.

func (Min) Aggregate

func (aggr Min) Aggregate(v any) error

Aggregate aggregates a map or an array. The map represents a row of data, and the array is a list of rows. If grouping is enabled, the array row must have a group value as the first element.

func (Min) AggregateMap

func (aggr Min) AggregateMap(m map[string]any) error

AggregateMap aggregates a map of data using the aggregator.

func (Min) AggregateRow

func (aggr Min) AggregateRow(row []any) error

AggregateRow aggregates a row of data using the aggregator. The row is expected to be an array where the first element is the group value (if grouping is enabled),

func (Min) Arguments

func (aggr Min) Arguments() []string

Arguments returns the arguments of the aggregator.

func (Min) Finalize

func (aggr Min) Finalize() (ResultSet, error)

Finalize finalizes the aggregation and returns the result.

func (Min) GroupBy

func (aggr Min) GroupBy() (string, bool)

GroupBy returns the group by column name and a boolean indicating if it is set.

func (Min) Name

func (aggr Min) Name() string

Name returns the name of the aggregator.

func (Min) Reset

func (aggr Min) Reset(opts ...any) error

Reset resets the aggregator to its initial state.

func (Min) Type

func (aggrImpl Min) Type() FunctionType

Type returns the type of the aggregator.

type MinOption

type MinOption = aggrOption

MinOption is a function that configures the Min aggregator.

func WithMinArguments

func WithMinArguments(args []string) MinOption

WithMinArguments sets the arguments for the Min aggregator.

func WithMinGroupBy

func WithMinGroupBy(group string) MinOption

WithMinGroupBy sets the group by column for the Min aggregator.

type ResultSet

type ResultSet interface {
	// Columns returns the column names.
	Columns() []string
	// Next returns the next row.
	Next() bool
	// Row returns the current row.
	Row() (Row, error)
	// Map returns the current row as a Map.
	Map() (Map, error)
}

ReseltSet is the result set of an aggregation.

func NewResultSet

func NewResultSet(opts ...resultSetOption) ResultSet

NewResultSet creates a new result set with the given options.

type Row

type Row []any

Row represents a row of data to be aggregated.

func NewRow

func NewRow(values ...any) Row

NewRow creates a new Row with the given values.

func (Row) Append

func (r Row) Append(values ...any) Row

Append appends values to the row.

type SelectorHelper

type SelectorHelper interface {
	// IsAsterisk returns true wheher the selector is an asterisk.
	IsAsterisk() bool
	// IsFunction returns true whether the selector is a function.
	IsFunction() bool
}

SelectorHelper provides additional methods for selectors.

type StringFunc

type StringFunc func([]string) (any, error)

type Sum

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

Sum is an aggregator that calculates the sum of values.

func NewSum

func NewSum(opts ...SumOption) (*Sum, error)

NewSum creates a new Sum aggregator with the given options.

func (Sum) Aggregate

func (aggr Sum) Aggregate(v any) error

Aggregate aggregates a map or an array. The map represents a row of data, and the array is a list of rows. If grouping is enabled, the array row must have a group value as the first element.

func (Sum) AggregateMap

func (aggr Sum) AggregateMap(m map[string]any) error

AggregateMap aggregates a map of data using the aggregator.

func (Sum) AggregateRow

func (aggr Sum) AggregateRow(row []any) error

AggregateRow aggregates a row of data using the aggregator. The row is expected to be an array where the first element is the group value (if grouping is enabled),

func (Sum) Arguments

func (aggr Sum) Arguments() []string

Arguments returns the arguments of the aggregator.

func (Sum) Finalize

func (aggr Sum) Finalize() (ResultSet, error)

Finalize finalizes the aggregation and returns the result.

func (Sum) GroupBy

func (aggr Sum) GroupBy() (string, bool)

GroupBy returns the group by column name and a boolean indicating if it is set.

func (Sum) Name

func (aggr Sum) Name() string

Name returns the name of the aggregator.

func (Sum) Reset

func (aggr Sum) Reset(opts ...any) error

Reset resets the aggregator to its initial state.

func (Sum) Type

func (aggrImpl Sum) Type() FunctionType

Type returns the type of the aggregator.

type SumOption

type SumOption = aggrOption

SumOption is a function that configures the Sum aggregator.

func WithSumArguments

func WithSumArguments(args []string) SumOption

WithSumArguments sets the arguments for the Sum aggregator.

func WithSumGroupBy

func WithSumGroupBy(group string) SumOption

WithSumGroupBy sets the group by column for the Sum aggregator.

type TimeFunc

type TimeFunc func([]string) (any, error)

Jump to

Keyboard shortcuts

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