reducer

package
v1.0.0-alpha.5 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

func DeepCopy

func DeepCopy(input interface{}) interface{}

Types

type DebugLogger

type DebugLogger func(input, output interface{})

type FilterFunc

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

type Func

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

func (Func) Reduce

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

type Interface

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

func Debug

func Debug(reducer Interface, logger DebugLogger) Interface

func DebugReducers

func DebugReducers(reducers Reducers, logger DebugLogger) Interface

func DeepMapValue

func DeepMapValue(fn MapFunc) Interface

func DeleteNested

func DeleteNested(keys []string) Interface

func FilterKey

func FilterKey(fn FilterFunc) Interface

func MapReduceValue

func MapReduceValue(reducer Interface) Interface

func MapValue

func MapValue(fn MapFunc) Interface

func Merge

func Merge(source interface{}) Interface

func MergeWith

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

func ReduceNested

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

func SetNested

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

type MapFunc

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

type Reducers

type Reducers []Interface

func (Reducers) Reduce

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