Documentation
¶
Index ¶
- Variables
- func AdaptError(err error, exitCode int) *cli.ExitError
- func AdaptErrorWithMessage(err error, msg string, exitCode int) *cli.ExitError
- func AddrOf[T any](value T) *T
- func ArrayEqual[T comparable](this, that []T) bool
- func Contains[I comparable](collection []I, item I) bool
- func ContainsWithMatcher[I any](collection []I, matcher func(other I) bool) bool
- func DistinctItems[V any](items []V, identityFn func(item V) string) []V
- func Filter[I any](collection []I, filter func(item I) bool) []I
- func FilterMap[K, V comparable](source map[K]V, filter func(key K, value V) bool) map[K]V
- func IndexOf[I comparable](collection []I, item I) int
- func IndexOfWithMatcher[I any](collection []I, matcher func(other I) bool) int
- func Map[E, R any](elements []E, mapper func(element E) R) []R
- func MapMapper[K comparable, V, R any](elements map[K]V, mapper func(key K, element V) R) []R
- func MapWithIterator[E, R any](iterator Iterator[E], mapper func(element E) R) []R
- func Min[T Numbers](i, o T) T
- func RandomNumber(min, max int) int
- func RandomTextString(length int) string
- func Sort[I any](collection []I, less func(this, other I) bool)
- type Channel
- type Iterator
- type MultiShutdownAwaiter
- type Numbers
- type Queue
- type ShutdownAwaiter
- type Waiter
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrWaiterTimeout = fmt.Errorf("waiter timed out")
Functions ¶
func AdaptErrorWithMessage ¶
func ArrayEqual ¶ added in v0.3.0
func ArrayEqual[T comparable](this, that []T) bool
func Contains ¶
func Contains[I comparable](collection []I, item I) bool
func ContainsWithMatcher ¶
func DistinctItems ¶
func FilterMap ¶
func FilterMap[K, V comparable](source map[K]V, filter func(key K, value V) bool) map[K]V
func IndexOf ¶
func IndexOf[I comparable](collection []I, item I) int
func IndexOfWithMatcher ¶
func MapMapper ¶ added in v0.0.12
func MapMapper[K comparable, V, R any](elements map[K]V, mapper func(key K, element V) R) []R
func MapWithIterator ¶
func RandomNumber ¶ added in v0.0.12
func RandomTextString ¶
Types ¶
type Channel ¶ added in v0.2.0
type Channel[T any] struct { // contains filtered or unexported fields }
Channel is based on https://github.com/jtarchie/ringbuffer, but extended with the option to skip waiting on an empty output channel
func NewChannel ¶ added in v0.2.0
func (*Channel[T]) ReadChannel ¶ added in v0.2.0
func (c *Channel[T]) ReadChannel() <-chan T
type MultiShutdownAwaiter ¶
type MultiShutdownAwaiter struct {
// contains filtered or unexported fields
}
func NewMultiShutdownAwaiter ¶
func NewMultiShutdownAwaiter(slots uint) *MultiShutdownAwaiter
func (*MultiShutdownAwaiter) AwaitDone ¶
func (msa *MultiShutdownAwaiter) AwaitDone()
func (*MultiShutdownAwaiter) AwaitShutdown ¶
func (msa *MultiShutdownAwaiter) AwaitShutdown(slot uint) error
func (*MultiShutdownAwaiter) AwaitShutdownChan ¶
func (msa *MultiShutdownAwaiter) AwaitShutdownChan(slot uint) <-chan bool
func (*MultiShutdownAwaiter) SignalDone ¶
func (msa *MultiShutdownAwaiter) SignalDone()
func (*MultiShutdownAwaiter) SignalShutdown ¶
func (msa *MultiShutdownAwaiter) SignalShutdown()
type ShutdownAwaiter ¶
type ShutdownAwaiter struct {
// contains filtered or unexported fields
}
func NewShutdownAwaiter ¶
func NewShutdownAwaiter() *ShutdownAwaiter
func (*ShutdownAwaiter) AwaitDone ¶
func (sa *ShutdownAwaiter) AwaitDone() error
func (*ShutdownAwaiter) AwaitShutdown ¶
func (sa *ShutdownAwaiter) AwaitShutdown() error
func (*ShutdownAwaiter) AwaitShutdownChan ¶
func (sa *ShutdownAwaiter) AwaitShutdownChan() <-chan bool
func (*ShutdownAwaiter) SignalDone ¶
func (sa *ShutdownAwaiter) SignalDone()
func (*ShutdownAwaiter) SignalShutdown ¶
func (sa *ShutdownAwaiter) SignalShutdown()
type Waiter ¶
type Waiter struct {
// contains filtered or unexported fields
}
func NewWaiterWithTimeout ¶
Click to show internal directories.
Click to hide internal directories.