Documentation ¶
Index ¶
- func Abs(n int) int
- func BoolAddr(b bool) *bool
- func CopyMap[K comparable, V any](m map[K]V) map[K]V
- func Filter[K any](slice []K, keep func(k K) bool) []K
- func GetEnv(key, fallback string) string
- func GetEnvBool(key string, fallback bool) bool
- func GetEnvOrError(key string) (string, error)
- func GetKeys[K comparable, V any](maps ...map[K]V) []K
- func GetNamespacedName(object HasNamespacedName) types.NamespacedName
- func HashFnv32a(str string) string
- func InSlice[K comparable](item K, slice []K) bool
- func IterPermutations[K any](slice []K, f func(k []K) (bool, error)) error
- func LocalEndpoint(path, file string) (string, error)
- func Max[K constraints.Ordered](v1 K, v2 K) K
- func Min[K constraints.Ordered](v1 K, v2 K) K
- func RandomStringLowercase(n int) string
- func ResetTimer(timer *time.Timer, duration time.Duration)
- func StopTimer(timer *time.Timer)
- func StringAddr(s string) *string
- func UnorderedEqual[K any](first []K, second []K) bool
- type Batcher
- type HasNamespacedName
- type PermutationGenerator
- type Set
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CopyMap ¶
func CopyMap[K comparable, V any](m map[K]V) map[K]V
func GetEnvBool ¶
func GetEnvOrError ¶
func GetKeys ¶
func GetKeys[K comparable, V any](maps ...map[K]V) []K
func GetNamespacedName ¶
func GetNamespacedName(object HasNamespacedName) types.NamespacedName
func HashFnv32a ¶
func InSlice ¶
func InSlice[K comparable](item K, slice []K) bool
func IterPermutations ¶
IterPermutations calls `f` providing as argument each possible permutation `slice`. It stops iterating if `f` returns either `false` or an error, and it returns an error if any call to `f` returns error.
func LocalEndpoint ¶
LocalEndpoint returns the full path to a unix socket at the given endpoint
func Max ¶
func Max[K constraints.Ordered](v1 K, v2 K) K
func Min ¶
func Min[K constraints.Ordered](v1 K, v2 K) K
func RandomStringLowercase ¶
func ResetTimer ¶
ResetTimer stops&drains the provided timer and resets it to the provided duration
func StringAddr ¶
func UnorderedEqual ¶
Types ¶
type Batcher ¶
type Batcher[T any] struct { // contains filtered or unexported fields }
func NewBatcher ¶
func NewBufferedBatcher ¶
type HasNamespacedName ¶
type PermutationGenerator ¶
type PermutationGenerator[K any] struct { // contains filtered or unexported fields }
func NewPermutationGenerator ¶
func NewPermutationGenerator[K any](sourceSlice []K) PermutationGenerator[K]
func (*PermutationGenerator[K]) Next ¶
func (p *PermutationGenerator[K]) Next() bool
func (*PermutationGenerator[K]) Permutation ¶
func (p *PermutationGenerator[K]) Permutation() []K
Click to show internal directories.
Click to hide internal directories.