Versions in this module Expand all Collapse all v1 v1.6.0 May 30, 2025 v1.5.2 May 30, 2025 Changes in this version + const AbsFunctionName + const AddOperatorID + const Asterisk + const AvgFunctionName + const CeilFunctionName + const CosFunctionName + const CountFunctionName + const CurrentTimestampFunctionName + const DivOperatorID + const ExpFunctionName + const FloorFunctionName + const Log10FunctionName + const LogFunctionName + const LowerFunctionName + const MaxFunctionName + const MinFunctionName + const ModFunctionName + const ModOperatorID + const MulOperatorID + const NowFunctionName + const PiFunctionName + const PowerFunctionName + const RandFunctionName + const RoundFunctionName + const SinFunctionName + const SqrtFunctionName + const SubOperatorID + const SumFunctionName + const TanFunctionName + const TrimFunctionName + const UpperFunctionName + var ErrInvalid = errors.New("invalid") + var ErrNegativeValue = errors.New("negative value") + var ErrNoData = errors.New("no data") + var ErrNotFound = errors.New("not found") + var ErrNotImplemented = errors.New("not implemented") + var ErrNotSupported = errors.New("not supported") + func ExecuteFunction(name string, v any) (any, error) + func IsRegisteredFunction(name string) bool + func NewStringFunctionWith(name string, t StringFunc, opts ...ExecutorOption) *stringFunction + func NewTimeFunctionWith(name string, t TimeFunc, opts ...ExecutorOption) *timeFunction + func RegisteredFunctionNames() []string + func WithColumns(columns []string) resultSetOption + func WithRows(rows []Row) resultSetOption + type AggrAggregateFunc func(aggr *aggrImpl, accumulatedValue float64, inputValue float64) (float64, error) + type AggrFinalizeFunc func(aggr *aggrImpl, accumulatedValue float64, accumulatedCount int) (any, error) + type AggrResetFunc func(aggr *aggrImpl) (float64, error) + type Aggregator interface + Aggregate func(v any) error + Arguments func() []string + Finalize func() (ResultSet, error) + GroupBy func() (string, bool) + Name func() string + Reset func(opts ...any) error + Type func() FunctionType + func NewAggregatorForName(name string, opts ...AggregatorOption) (Aggregator, error) + type AggregatorOption = aggrOption + func WithAggregatorArguments(args []string) AggregatorOption + func WithAggregatorGroupBy(group string) AggregatorOption + func WithAggregatorName(name string) AggregatorOption + type AggregatorSet []Aggregator + func NewAggregatorSetForNames(names []string, opts ...aggrOption) (AggregatorSet, error) + func NewAggregatorSetWith(aggrs []Aggregator) AggregatorSet + func (aggrSet *AggregatorSet) Aggregate(v any) error + func (aggrSet *AggregatorSet) Finalize() (ResultSet, error) + func (aggrSet *AggregatorSet) Reset(opts ...any) error + type Argument string + func NewArgumentWith(arg string) Argument + func (arg Argument) IsAsterisk() bool + func (arg Argument) IsName(name string) bool + func (arg Argument) Name() string + func (arg Argument) String() string + type Arguments []Argument + func NewArgumentStrings(strs ...string) Arguments + func NewArguments() Arguments + func NewArgumentsWith(args ...Argument) Arguments + func (args Arguments) IsAsterisk() bool + func (args Arguments) Names() []string + func (args Arguments) String() string + type ArithFunc func(float64, float64) (float64, error) + type Avg struct + func NewAvg(opts ...AvgOption) (*Avg, error) + func (aggr Avg) Aggregate(v any) error + func (aggr Avg) AggregateMap(m map[string]any) error + func (aggr Avg) AggregateRow(row []any) error + func (aggr Avg) Arguments() []string + func (aggr Avg) Finalize() (ResultSet, error) + func (aggr Avg) GroupBy() (string, bool) + func (aggr Avg) Name() string + func (aggr Avg) Reset(opts ...any) error + func (aggrImpl Avg) Type() FunctionType + type AvgOption = aggrOption + func WithAvgArguments(args []string) AvgOption + func WithAvgGroupBy(group string) AvgOption + type CastFunc = func(any) (any, error) + type Count struct + func NewCount(opts ...CountOption) (*Count, error) + func (aggr Count) Aggregate(v any) error + func (aggr Count) AggregateMap(m map[string]any) error + func (aggr Count) AggregateRow(row []any) error + func (aggr Count) Arguments() []string + func (aggr Count) Finalize() (ResultSet, error) + func (aggr Count) GroupBy() (string, bool) + func (aggr Count) Name() string + func (aggr Count) Reset(opts ...any) error + func (aggrImpl Count) Type() FunctionType + type CountOption = aggrOption + func WithCountArguments(args []string) CountOption + func WithCountGroupBy(group string) CountOption + type Executor interface + Arguments func() []string + Execute func(any) (any, error) + Name func() string + Type func() FunctionType + func NewAbs(opts ...ExecutorOption) Executor + func NewAddOperator(opts ...ExecutorOption) Executor + func NewArithFunctionWith(name string, arithFn ArithFunc, opts ...ExecutorOption) Executor + func NewArithOperatorFor(ope string, opts ...ExecutorOption) (Executor, error) + func NewCastFunctionWith(name string, castFn CastFunc) Executor + func NewCeil(opts ...ExecutorOption) Executor + func NewCos(opts ...ExecutorOption) Executor + func NewCurrentTimestamp(opts ...ExecutorOption) Executor + func NewDivOperator(opts ...ExecutorOption) Executor + func NewExecutorForName(name string, opts ...ExecutorOption) (Executor, error) + func NewExp(opts ...ExecutorOption) Executor + func NewFloor(opts ...ExecutorOption) Executor + func NewLog(opts ...ExecutorOption) Executor + func NewLog10(opts ...ExecutorOption) Executor + func NewLower(opts ...ExecutorOption) Executor + func NewMathFunctionWith(name string, mathFn MathFunc, opts ...ExecutorOption) Executor + func NewMod(opts ...ExecutorOption) Executor + func NewModOperator(opts ...ExecutorOption) Executor + func NewMulOperator(opts ...ExecutorOption) Executor + func NewNow(opts ...ExecutorOption) Executor + func NewPI(opts ...ExecutorOption) Executor + func NewPower(opts ...ExecutorOption) Executor + func NewRand(opts ...ExecutorOption) Executor + func NewRound(opts ...ExecutorOption) Executor + func NewSin(opts ...ExecutorOption) Executor + func NewSqrt(opts ...ExecutorOption) Executor + func NewSubOperator(opts ...ExecutorOption) Executor + func NewTan(opts ...ExecutorOption) Executor + func NewTrim(opts ...ExecutorOption) Executor + func NewUpper(opts ...ExecutorOption) Executor + type ExecutorOption = execOption + func WithExecutorArguments(args []string) ExecutorOption + func WithExecutorName(name string) ExecutorOption + type Function interface + Aggregator func(opts ...AggregatorOption) (Aggregator, error) + Arguments func() Arguments + Executor func(opts ...ExecutorOption) (Executor, error) + Function func() (Function, bool) + IsAggregator func() bool + IsFunction func() bool + IsName func(string) bool + IsType func(FunctionType) bool + Name func() string + String func() string + Type func() FunctionType + func NewFunctionWith(opts ...FunctionOption) Function + type FunctionOption = func(*function) + func WithFunctionAggregator(aggregator Aggregator) FunctionOption + func WithFunctionArguments(args ...Argument) FunctionOption + func WithFunctionExecutor(executor Executor) FunctionOption + func WithFunctionName(name string) FunctionOption + func WithFunctionType(t FunctionType) FunctionOption + type FunctionType int + const AggregateFunction + const ArithOperator + const CastFunction + const MathFunction + const StringFunction + const TimeFunction + const UnknownFunctionType + func NewFunctionTypeForName(name string) (FunctionType, error) + type GroupBy string + type Map map[string]any + func NewMapWithMap(m map[string]any) Map + func NewMapWithRow(columns []string, row Row) Map + type MathFunc func([]float64) (any, error) + type MathResultSet map[any]float64 + type Max struct + func NewMax(opts ...MaxOption) (*Max, error) + func (aggr Max) Aggregate(v any) error + func (aggr Max) AggregateMap(m map[string]any) error + func (aggr Max) AggregateRow(row []any) error + func (aggr Max) Arguments() []string + func (aggr Max) Finalize() (ResultSet, error) + func (aggr Max) GroupBy() (string, bool) + func (aggr Max) Name() string + func (aggr Max) Reset(opts ...any) error + func (aggrImpl Max) Type() FunctionType + type MaxOption = aggrOption + func WithMaxArguments(args []string) MaxOption + func WithMaxGroupBy(group string) MaxOption + type Min struct + func NewMin(opts ...MinOption) (*Min, error) + func (aggr Min) Aggregate(v any) error + func (aggr Min) AggregateMap(m map[string]any) error + func (aggr Min) AggregateRow(row []any) error + func (aggr Min) Arguments() []string + func (aggr Min) Finalize() (ResultSet, error) + func (aggr Min) GroupBy() (string, bool) + func (aggr Min) Name() string + func (aggr Min) Reset(opts ...any) error + func (aggrImpl Min) Type() FunctionType + type MinOption = aggrOption + func WithMinArguments(args []string) MinOption + func WithMinGroupBy(group string) MinOption + type ResultSet interface + Columns func() []string + Map func() (Map, error) + Next func() bool + Row func() (Row, error) + func NewResultSet(opts ...resultSetOption) ResultSet + type Row []any + func NewRow(values ...any) Row + func (r Row) Append(values ...any) Row + type SelectorHelper interface + IsAsterisk func() bool + IsFunction func() bool + type StringFunc func([]string) (any, error) + type Sum struct + func NewSum(opts ...SumOption) (*Sum, error) + func (aggr Sum) Aggregate(v any) error + func (aggr Sum) AggregateMap(m map[string]any) error + func (aggr Sum) AggregateRow(row []any) error + func (aggr Sum) Arguments() []string + func (aggr Sum) Finalize() (ResultSet, error) + func (aggr Sum) GroupBy() (string, bool) + func (aggr Sum) Name() string + func (aggr Sum) Reset(opts ...any) error + func (aggrImpl Sum) Type() FunctionType + type SumOption = aggrOption + func WithSumArguments(args []string) SumOption + func WithSumGroupBy(group string) SumOption + type TimeFunc func([]string) (any, error)