Documentation ¶
Index ¶
- func FilterFunc[K comparable, V any](oldMap map[K]V, cmp func(key K, val V) (ok bool)) (newMap map[K]V)
- func FilterWithPrefix[V any](oldMap map[string]V, prefix string) (newMap map[string]V)
- func ProjectFunc[K comparable, V any](oldMap map[K]V, proj func(oldKey K, val V) (newKey K, ok bool)) (newMap map[K]V)
- func ProjectWithPrefix[V any](oldMap map[string]V, prefix string) (newMap map[string]V)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FilterFunc ¶
func FilterFunc[K comparable, V any](oldMap map[K]V, cmp func(key K, val V) (ok bool)) (newMap map[K]V)
FilterFunc filters a map by a custom function, the function should return a boolean indicating if the key should be included.
func FilterWithPrefix ¶
FilterWithPrefix filters a map by a prefix, only keys with the prefix will be included.
func ProjectFunc ¶
func ProjectFunc[K comparable, V any](oldMap map[K]V, proj func(oldKey K, val V) (newKey K, ok bool)) (newMap map[K]V)
ProjectFunc projects a map by a custom function, the function should return the new key and a boolean indicating if the key should be included.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.