Documentation
¶
Index ¶
- Variables
- func AllAreNil(ptrs ...any) bool
- func CountNotNil(ptrs ...any) int
- func Default[T any](t *T, defaultValue T) T
- func IsPointer[T any](v T) bool
- func Jitter() time.Duration
- func JitterFunc(min *int, maxMinusMin *int) func() time.Duration
- func NonNil[T any](ptrs []*T) []T
- func NoneAreNil(ptrs ...any) bool
- func OneIsDefined(ptrs ...any) bool
- func Pointer[T any](t T) *T
- func PtrContains[T comparable](t *T, value T) bool
- func Retry[T any](f func() (T, error)) (t T, err error)
- func RetryTimes[T any](numRetries int, f func() (T, error)) (t T, err error)
- type ErrAnd
- type Result
- type Set
Constants ¶
This section is empty.
Variables ¶
View Source
var NotFound = errors.New("not found")
Functions ¶
func CountNotNil ¶
func NoneAreNil ¶
func OneIsDefined ¶
func PtrContains ¶
func PtrContains[T comparable](t *T, value T) bool
Types ¶
type Set ¶
type Set[T comparable] map[T]struct{}
func MapUniqueChildren ¶
func MapUniqueChildren[T any, U comparable](allItems []T, getChild func(T) U) Set[U]
TODO: TEST ME
func SetFrom ¶
func SetFrom[T comparable](ts ...T) Set[T]
func SetOf ¶
func SetOf[T comparable](items []T) Set[T]
SetOf returns a set only containing unique values of items passed in
func (Set[T]) MarshalJSON ¶
func (*Set[T]) UnmarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.