Documentation ¶
Index ¶
- func DeduplicateStrings(src []string) []string
- func EqualSliceValues[E comparable](s1, s2 []E) bool
- func MergeSlices[T any](slices ...[]T) []T
- func Paginate[T any](get func(page int) ([]T, error)) ([]T, error)
- func SliceToBoolMap(s []string) map[string]bool
- func StringSliceDeleteEmpty(s []string) []string
- func WithContextSigtermCallback(ctx context.Context, f func()) context.Context
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeduplicateStrings ¶ added in v2.5.0
DeduplicateStrings deduplicate string list, empty items are dropped.
func EqualSliceValues ¶
func EqualSliceValues[E comparable](s1, s2 []E) bool
EqualSliceValues compare two slices if they have equal values independent of how they are sorted.
func MergeSlices ¶
func MergeSlices[T any](slices ...[]T) []T
MergeSlices return a new slice that combines all values of input slices TODO: once https://github.com/golang/go/pull/61817 got merged, we should switch to it
func Paginate ¶
Paginate iterates over a func call until it does not return new items and return it as list.
func SliceToBoolMap ¶
SliceToBoolMap is a helper function to convert a string slice to a map.
func StringSliceDeleteEmpty ¶ added in v2.4.0
StringSliceDeleteEmpty removes empty strings from a string slice.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.