functions

package
v0.1.14 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2023 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CountForm = forms.Form{
	ErrorMsg: "invalid data encountered in the count config",
	Fields: []forms.Field{
		{
			Name: "epsilon",
			Validators: []forms.Validator{
				forms.IsOptional{Default: 0.5},
				forms.IsFloat{HasMin: true, Min: 0.01, HasMax: false},
			},
		},
		{
			Name: "treshold",
			Validators: []forms.Validator{
				forms.IsOptional{Default: 0},
				forms.IsInteger{HasMin: true, Min: 0, HasMax: false},
			},
		},
	},
}
View Source
var Functions = map[string]FunctionMaker{
	"count":   MakeCountFunction,
	"uniques": MakeUniquesFunction,
}
View Source
var UniquesForm = forms.Form{
	ErrorMsg: "invalid data encountered in the uniques config",
	Fields: []forms.Field{
		{
			Name: "id",
			Validators: []forms.Validator{
				forms.IsRequired{},
				forms.IsString{},
			},
		},
		{
			Name: "epsilon",
			Validators: []forms.Validator{
				forms.IsOptional{Default: 0.5},
				forms.IsFloat{HasMin: true, Min: 0.01, HasMax: false},
			},
		},
	},
}

Functions

func MakeCountFunction

func MakeCountFunction(config map[string]interface{}) (aggregate.Function, error)

func MakeUniquesFunction

func MakeUniquesFunction(config map[string]interface{}) (aggregate.Function, error)

Types

type Count

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

func (*Count) Add

func (c *Count) Add(item *kodex.Item, group aggregate.Group) error

func (*Count) Finalize

func (c *Count) Finalize(group aggregate.Group) (interface{}, error)

func (*Count) Initialize

func (c *Count) Initialize(group aggregate.Group) error

func (*Count) Merge

func (c *Count) Merge(groups []aggregate.Group) (aggregate.Group, error)

type FunctionMaker

type FunctionMaker func(map[string]interface{}) (aggregate.Function, error)

type Int64

type Int64 struct {
	I int64
}

func (*Int64) Clone

func (i *Int64) Clone() (aggregate.State, error)

func (*Int64) Deserialize

func (i *Int64) Deserialize(buf []byte) error

func (*Int64) Serialize

func (i *Int64) Serialize() ([]byte, error)

type Max

type Max struct {
}

type Mean

type Mean struct {
}

type Median

type Median struct {
}

type Min

type Min struct {
}

type StringBoolMap

type StringBoolMap struct {
	M map[string]bool
}

func (*StringBoolMap) Clone

func (m *StringBoolMap) Clone() (aggregate.State, error)

func (*StringBoolMap) Deserialize

func (m *StringBoolMap) Deserialize(buf []byte) error

func (*StringBoolMap) Serialize

func (m *StringBoolMap) Serialize() ([]byte, error)

type Uniques

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

func (*Uniques) Add

func (c *Uniques) Add(item *kodex.Item, group aggregate.Group) error

func (*Uniques) Finalize

func (c *Uniques) Finalize(group aggregate.Group) (interface{}, error)

func (*Uniques) Initialize

func (c *Uniques) Initialize(group aggregate.Group) error

func (*Uniques) Merge

func (c *Uniques) Merge(groups []aggregate.Group) (aggregate.Group, error)

type Variance

type Variance struct {
}

Jump to

Keyboard shortcuts

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