Documentation
¶
Index ¶
- func GetMapSlice[K comparable, V any](itemsMap map[K][]V, key K) ([]V, error)
- func GetMapValue[K comparable, V any](itemMap map[K]V, key K) (item V, err error)
- func GroupBy[I, K comparable](items []I, keyFn func(item *I) K) (map[K][]I, error)
- func GroupTo[I, K comparable, O any](items []I, keyFn func(item *I) K, parseFn func(item *I) O) (map[K][]O, error)
- func IndexBy[I, K comparable](items []I, keyFn func(item *I) K) (map[K]I, error)
- func IndexTo[I, K comparable, O any](items []I, keyFn func(item *I) K, parseFn func(item *I) O) (map[K]O, error)
- func TransformMapSlices[K comparable, V, O any](itemsMap map[K][]V, parseFn func([]V) []O) map[K][]O
- func TransformMapValues[K comparable, V, O any](itemsMap map[K]V, parseFn func(V) O) map[K]O
- func TransformSlice[I, O any](items []I, parseFn func(item I) O) []O
- func Unique[K comparable](items []K) []K
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetMapSlice ¶
func GetMapSlice[K comparable, V any](itemsMap map[K][]V, key K) ([]V, error)
func GetMapValue ¶
func GetMapValue[K comparable, V any](itemMap map[K]V, key K) (item V, err error)
func GroupBy ¶
func GroupBy[I, K comparable](items []I, keyFn func(item *I) K) (map[K][]I, error)
func GroupTo ¶
func GroupTo[I, K comparable, O any](items []I, keyFn func(item *I) K, parseFn func(item *I) O) (map[K][]O, error)
func IndexBy ¶
func IndexBy[I, K comparable](items []I, keyFn func(item *I) K) (map[K]I, error)
func IndexTo ¶
func IndexTo[I, K comparable, O any](items []I, keyFn func(item *I) K, parseFn func(item *I) O) (map[K]O, error)
func TransformMapSlices ¶
func TransformMapSlices[K comparable, V, O any](itemsMap map[K][]V, parseFn func([]V) []O) map[K][]O
func TransformMapValues ¶
func TransformMapValues[K comparable, V, O any](itemsMap map[K]V, parseFn func(V) O) map[K]O
func TransformSlice ¶
func TransformSlice[I, O any](items []I, parseFn func(item I) O) []O
func Unique ¶ added in v1.1.0
func Unique[K comparable](items []K) []K
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.