reducer

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 2, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotArrayOrMap = xerrors.New("expected an array or a map")
View Source
var ErrNotMap = xerrors.New("expected a map")

Functions

func DeepCopy added in v0.2.0

func DeepCopy(input interface{}) interface{}

Types

type DebugLogger added in v0.2.0

type DebugLogger func(input, output interface{})

type FilterFunc added in v0.2.0

type FilterFunc func(interface{}) (bool, error)

type Func added in v0.2.0

type Func func(interface{}) (interface{}, error)

func (Func) Reduce added in v0.2.0

func (r Func) Reduce(input interface{}) (interface{}, error)

type Interface

type Interface interface {
	Reduce(input interface{}) (interface{}, error)
}

func Debug added in v0.2.0

func Debug(reducer Interface, logger DebugLogger) Interface

func DebugReducers added in v0.2.0

func DebugReducers(reducers Reducers, logger DebugLogger) Interface

func DeepMapValue added in v0.2.0

func DeepMapValue(fn MapFunc) Interface

func DeleteNested added in v0.2.0

func DeleteNested(keys []string) Interface

func FilterKey added in v0.2.0

func FilterKey(fn FilterFunc) Interface

func MapReduceValue added in v0.2.0

func MapReduceValue(reducer Interface) Interface

func MapValue added in v0.2.0

func MapValue(fn MapFunc) Interface

func Merge

func Merge(source interface{}) Interface

func MergeWith added in v0.2.0

func MergeWith(source interface{}, fn merge.Func) Interface

func ReduceNested added in v0.2.0

func ReduceNested(keys []string, reducer Interface) Interface

func SetNested added in v0.2.0

func SetNested(keys []string, value interface{}) Interface

type MapFunc added in v0.2.0

type MapFunc func(interface{}) (interface{}, error)

type Reducers added in v0.2.0

type Reducers []Interface

func (Reducers) Reduce added in v0.2.0

func (r Reducers) Reduce(input interface{}) (interface{}, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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