genq

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AggregationFunc

type AggregationFunc[V any] func(values []V) V

type Filter

type Filter[V any] struct {
	// contains filtered or unexported fields
}

func NewFilter

func NewFilter[V any](fn FilterFunc[V], source Source[V]) *Filter[V]

func (*Filter[V]) And

func (f *Filter[V]) And(operands ...FilterFunc[V]) *Filter[V]

func (*Filter[V]) Or

func (f *Filter[V]) Or(operands ...FilterFunc[V]) *Filter[V]

func (*Filter[V]) Resolve

func (f *Filter[V]) Resolve() []V

func (*Filter[V]) Where

func (f *Filter[V]) Where(operands ...FilterFunc[V]) *Filter[V]

type FilterFunc

type FilterFunc[V any] func(v V) bool

func And

func And[V any](operands ...FilterFunc[V]) FilterFunc[V]

func False

func False[V any]() FilterFunc[V]

func Not

func Not[V any](f FilterFunc[V]) FilterFunc[V]

func Or

func Or[V any](operands ...FilterFunc[V]) FilterFunc[V]

func True

func True[V any]() FilterFunc[V]

func (FilterFunc[V]) And

func (f FilterFunc[V]) And(operands ...FilterFunc[V]) FilterFunc[V]

func (FilterFunc[V]) Not

func (f FilterFunc[V]) Not() FilterFunc[V]

func (FilterFunc[V]) Or

func (f FilterFunc[V]) Or(operands ...FilterFunc[V]) FilterFunc[V]

type Group

type Group[K comparable, V any] struct {
	// contains filtered or unexported fields
}

func NewGroup

func NewGroup[K comparable, V any](fn GroupFunc[K, V], sources ...Source[V]) *Group[K, V]

func (*Group[K, V]) Aggregate

func (g *Group[K, V]) Aggregate(fn AggregationFunc[V]) map[K]V

func (*Group[K, V]) AggregateFlat

func (g *Group[K, V]) AggregateFlat(fn AggregationFunc[V]) []V

func (*Group[K, V]) AsMap

func (g *Group[K, V]) AsMap() map[K][]V

func (*Group[K, V]) Flat

func (g *Group[K, V]) Flat() []V

func (*Group[K, V]) Resolve

func (g *Group[K, V]) Resolve() []V

type GroupFunc

type GroupFunc[K comparable, V any] func(v V) K

type Source

type Source[V any] interface {
	Resolve() []V
}

Jump to

Keyboard shortcuts

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