Documentation
¶
Index ¶
- func Filter[T any](f func(v T) bool, values ...T) []T
- func Map[T any, U any](f func(v T) U, values ...T) []U
- func Or[T comparable](value T, orValue T) T
- func Retry(config *RetryConfig, executor func() error) error
- func SigFigDur(t time.Duration, sigFigs int) string
- func Unique[T comparable](values ...T) []T
- type RetryConfig
- type Set
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Or ¶ added in v0.1.4
func Or[T comparable](value T, orValue T) T
Or returns the orValue when value is the zero value for a given type
func Retry ¶ added in v0.2.0
func Retry(config *RetryConfig, executor func() error) error
Retry will execute the provided executor function multiple times with an interim delay, reporting the final error status in the event of a terminal failure
func SigFigDur ¶ added in v0.1.2
SigFigDur renders duration to a fixed number of significant figures, independent of the unit of measure.
func Unique ¶
func Unique[T comparable](values ...T) []T
Unique returns a slice from the original containing only unique elements
Types ¶
type RetryConfig ¶ added in v0.2.0
type Set ¶
type Set[T comparable] struct { // contains filtered or unexported fields }
func NewSet ¶
func NewSet[T comparable](values ...T) *Set[T]
NewSet creates a new set, initialized with values
func NewSetFromMap ¶ added in v0.2.0
func NewSetFromMap[T comparable, X any](values map[T]X) *Set[T]
func (*Set[T]) Items ¶ added in v0.1.1
func (s *Set[T]) Items() []T
Items returns a slice of the items in the set
Click to show internal directories.
Click to hide internal directories.