Documentation
¶
Overview ¶
Package collect provide functions for manipulating collections via reflect
Index ¶
- func MapKeys(value interface{}) interface{}
- func MapMap(value interface{}, mapFunc interface{}) interface{}
- func MapMapWithKeys(value interface{}, mapFunc interface{}) interface{}
- func MapReduce(mapValue interface{}, initialValue interface{}, reduceFunc interface{}) interface{}
- func MapUnique(value interface{}) interface{}
- func SliceMap(value interface{}, mapFunc interface{}) interface{}
- func SliceMapWithKeys(value interface{}, mapFunc interface{}) interface{}
- func SliceReduce(value interface{}, initialValue interface{}, mapFunc interface{}) interface{}
- func SliceUnique(value interface{}) interface{}
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MapKeys ¶
func MapKeys(value interface{}) interface{}
MapKeys func returns all of the map keys as slice
func MapMap ¶
func MapMap(value interface{}, mapFunc interface{}) interface{}
MapMap func iterates through the map and passes each value to the given mapFunc. The mapFunc is free to modify the item and return it, thus forming a new slice of modified items
func MapMapWithKeys ¶
func MapMapWithKeys(value interface{}, mapFunc interface{}) interface{}
MapMapWithKeys func iterates through the map and passes each key and value to the given mapFunc. The mapFunc should return a single key / value pair
func MapReduce ¶
func MapReduce(mapValue interface{}, initialValue interface{}, reduceFunc interface{}) interface{}
MapReduce method reduces the map to a single value, passing the result of each iteration into the subsequent iteration:
func MapUnique ¶
func MapUnique(value interface{}) interface{}
MapUnique method returns all of the unique items in the map as new slice
func SliceMap ¶
func SliceMap(value interface{}, mapFunc interface{}) interface{}
SliceMap func iterates through the slice and passes each value to the given mapFunc. The mapFunc is free to modify the item and return it, thus forming a new slice of modified items
func SliceMapWithKeys ¶
func SliceMapWithKeys(value interface{}, mapFunc interface{}) interface{}
SliceMapWithKeys func iterates through the slice and passes each key and value to the given mapFunc. The mapFunc should return a single key / value pair
func SliceReduce ¶
func SliceReduce(value interface{}, initialValue interface{}, mapFunc interface{}) interface{}
SliceReduce method reduces the slice to a single value, passing the result of each iteration into the subsequent iteration:
func SliceUnique ¶
func SliceUnique(value interface{}) interface{}
SliceUnique method returns all of the unique items in the slice as new slice
Types ¶
This section is empty.