Documentation ¶
Index ¶
- func AddrWithPort(addr string, port string) string
- func Clamp[N Numeric](number, lower, upper N) N
- func Contains[T comparable](slice []T, element T) bool
- func Every[T any](slice []T, predicate func(T) bool) bool
- func Filter[T any](items []T, predicate func(item T) bool) []T
- func FilterMap[K comparable, V any](input map[K]V, predicate func(K, V) bool) map[K]V
- func FindIndex[T any](slice []T, predicate func(T) bool) int
- func Keys[K comparable, V any](input map[K]V) []K
- func Map[T any, U any](items []T, mapFn func(item T) U) []U
- func MapMap[K comparable, V any](input map[K]V, mapFn func(K, V) V) map[K]V
- func ReadTimeout[T any](channel <-chan T, timeout time.Duration) (T, error)
- func Remove[T any](slice []T, i int) (after []T, removed T)
- func Subtract[T comparable](slice []T, elements ...T) []T
- func TrySend[T any](channel chan<- T, value T) bool
- func Union[T comparable](slice []T, elements ...T) []T
- func Values[K comparable, V any](input map[K]V) []V
- func WriteAll(writer io.Writer, data []byte) (written int, err error)
- type ErrorList
- type MovingAverage
- type Numeric
- type ReaderFrom
- type RingBuf
- type Set
- type StackError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddrWithPort ¶
func Contains ¶
func Contains[T comparable](slice []T, element T) bool
func FilterMap ¶
func FilterMap[K comparable, V any](input map[K]V, predicate func(K, V) bool) map[K]V
func Keys ¶
func Keys[K comparable, V any](input map[K]V) []K
func MapMap ¶
func MapMap[K comparable, V any](input map[K]V, mapFn func(K, V) V) map[K]V
func Subtract ¶
func Subtract[T comparable](slice []T, elements ...T) []T
func Union ¶
func Union[T comparable](slice []T, elements ...T) []T
func Values ¶
func Values[K comparable, V any](input map[K]V) []V
Types ¶
type MovingAverage ¶
type MovingAverage[N Numeric] struct { // contains filtered or unexported fields }
func NewMovingAverage ¶
func NewMovingAverage[N Numeric](order uint) *MovingAverage[N]
func (*MovingAverage[N]) Add ¶
func (avg *MovingAverage[N]) Add(value N) N
func (*MovingAverage[N]) Grow ¶
func (avg *MovingAverage[N]) Grow(amount uint) N
func (*MovingAverage[N]) Order ¶
func (avg *MovingAverage[N]) Order() int
func (*MovingAverage[N]) Resize ¶
func (avg *MovingAverage[N]) Resize(order uint) N
func (*MovingAverage[N]) Shrink ¶
func (avg *MovingAverage[N]) Shrink(amount uint) N
type Numeric ¶
type Numeric interface { constraints.Integer | constraints.Float }
type RingBuf ¶
type RingBuf[T any] struct { // contains filtered or unexported fields }
func NewRingBuf ¶
type Set ¶
type Set[T comparable] struct { // contains filtered or unexported fields }
func NewSet ¶
func NewSet[T comparable]() Set[T]
type StackError ¶
type StackError struct {
// contains filtered or unexported fields
}
func NewStackError ¶
func NewStackError(err error) StackError
func (*StackError) AddStackEntry ¶
func (err *StackError) AddStackEntry(key string, value string)
func (StackError) Error ¶
func (err StackError) Error() string
Source Files ¶
Click to show internal directories.
Click to hide internal directories.