supporting

package
v0.0.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 4, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrWaiterTimeout = fmt.Errorf("waiter timed out")

Functions

func AdaptError

func AdaptError(err error, exitCode int) *cli.ExitError

func AdaptErrorWithMessage

func AdaptErrorWithMessage(err error, msg string, exitCode int) *cli.ExitError

func AddrOf

func AddrOf[T any](value T) *T

func Contains

func Contains[I comparable](collection []I, item I) bool

func ContainsWithMatcher

func ContainsWithMatcher[I comparable](collection []I, matcher func(other I) bool) bool

func DistinctItems

func DistinctItems[V any](items []V, identityFn func(item V) string) []V

func Filter

func Filter[I comparable](collection []I, filter func(item I) bool) []I

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 IndexOfWithMatcher[I comparable](collection []I, matcher func(other I) bool) int

func Map

func Map[E, R any](elements []E, mapper func(element E) R) []R

func MapWithIterator

func MapWithIterator[E, R any](iterator Iterator[E], mapper func(element E) R) []R

func RandomTextString

func RandomTextString(length int) string

func Sort

func Sort[I comparable](collection []I, less func(this, other I) bool)

Types

type Iterator

type Iterator[E any] func() (E, bool)

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 Queue

type Queue[E any] struct {
	// contains filtered or unexported fields
}

func NewQueue

func NewQueue[E any]() *Queue[E]

func (*Queue[E]) Lock

func (rq *Queue[E]) Lock()

func (*Queue[E]) Pop

func (rq *Queue[E]) Pop() E

func (*Queue[E]) Push

func (rq *Queue[E]) Push(fn E) bool

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 NewWaiter

func NewWaiter() *Waiter

func NewWaiterWithTimeout

func NewWaiterWithTimeout(timeout time.Duration) *Waiter

func (*Waiter) Await

func (w *Waiter) Await() error

func (*Waiter) Reset

func (w *Waiter) Reset()

func (*Waiter) Signal

func (w *Waiter) Signal()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL