quiter

package
v0.0.0-...-791c77c Latest Latest
Warning

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

Go to latest
Published: May 11, 2025 License: MIT Imports: 8 Imported by: 3

Documentation

Index

Constants

View Source
const (
	SortCompareLess = sortCompare(iota)
	SortCompareEqual
	SortCompareGreater
)

Variables

This section is empty.

Functions

func AddClone

func AddClone[E any, EPtr interface {
	*E
	ResetWithPtr(*E)
}](
	c interfaces.Adder[EPtr],
) interfaces.FuncIter[EPtr]

func AddClonePool

func AddClonePool[E any, EPtr interfaces.Ptr[E]](
	s interfaces.AdderPtr[E, EPtr],
	p interfaces.Pool[E, EPtr],
	r interfaces.Resetter2[E, EPtr],
	b EPtr,
) (err error)

func AddOrReplaceIfGreater

func AddOrReplaceIfGreater[T interface {
	interfaces.Stringer
	interfaces.ValueLike
	interfaces.Lessor[T]
}](
	c interfaces.MutableSetLike[T],
	b T,
) (shouldAdd bool, err error)

func AddString

func AddString[E any, EPtr interfaces.SetterPtr[E]](
	c interfaces.Adder[E],
	v string,
) (err error)

func Chain

func Chain[T any](e T, wfs ...interfaces.FuncIter[T]) (err error)

func DerivedValues

func DerivedValues[E any, F any](
	c interfaces.SetLike[E],
	f interfaces.FuncTransform[E, F],
) (out []F, err error)

func Elements

func Elements[T any](s interfaces.Collection[T]) (out []T)

func ElementsSorted

func ElementsSorted[T any](
	s interfaces.Collection[T],
	sf func(T, T) bool,
) (out []T)

func ErrorWaitGroupApply

func ErrorWaitGroupApply[T any](
	wg errors.WaitGroup,
	s interfaces.Collection[T],
	f interfaces.FuncIter[T],
) bool

func Len

func Len(cs ...interfaces.Lenner) (n int)

func MakeChain

func MakeChain[T any](wfs ...interfaces.FuncIter[T]) interfaces.FuncIter[T]

func MakeChainDebug

func MakeChainDebug[T any](wfs ...interfaces.FuncIter[T]) interfaces.FuncIter[T]

func MakeFuncSetString

func MakeFuncSetString[
	E any,
	EPtr interfaces.SetterPtr[E],
](
	c interfaces.Adder[E],
) interfaces.FuncSetString

func MakeIterDebug

func MakeIterDebug[T any](f interfaces.FuncIter[T]) interfaces.FuncIter[T]

func MakeSyncSerializer

func MakeSyncSerializer[T any](
	wf interfaces.FuncIter[T],
) interfaces.FuncIter[T]

func Multiplex

func Multiplex[T any](
	e interfaces.FuncIter[T],
	producers ...func(interfaces.FuncIter[T]) error,
) (err error)

func PrintPointer

func PrintPointer[T any, TPtr interfaces.Ptr[T]](e TPtr) (err error)

func ResetMap

func ResetMap[K comparable, V any](m map[K]V)

func ResetMutableSetWithPool

func ResetMutableSetWithPool[E any, EPtr interfaces.Ptr[E]](
	s interfaces.MutableSetPtrLike[E, EPtr],
	p interfaces.Pool[E, EPtr],
)

func ReverseSortable

func ReverseSortable(s sort.Interface)

func SetEquals

func SetEquals[T any](
	a, b interfaces.SetLike[T],
) bool

TODO refactor to use iterators

func SetEqualsPtr

func SetEqualsPtr[T any, TPtr interfaces.Ptr[T]](
	a, b interfaces.SetPtrLike[T, TPtr],
) bool

func SortedStrings

func SortedStrings[E interfaces.Stringer](
	cs ...interfaces.Collection[E],
) (out []string)

func SortedValues

func SortedValues[E interfaces.Value[E]](
	c interfaces.SetLike[E],
) (out []E)

func SortedValuesBy

func SortedValuesBy[E any](
	c interfaces.SetLike[E],
	sf func(E, E) bool,
) (out []E)

func StringCommaSeparated

func StringCommaSeparated[E interfaces.Stringer](
	cs ...interfaces.Collection[E],
) string

func StringDelimiterSeparated

func StringDelimiterSeparated[E interfaces.Stringer](
	d string,
	cs ...interfaces.Collection[E],
) string

func Strings

func Strings[E interfaces.Stringer](
	cs ...interfaces.Collection[E],
) (out []string)

Types

type AsyncSerializer

type AsyncSerializer[T any] struct {
	// contains filtered or unexported fields
}

func MakeAsyncSerializer

func MakeAsyncSerializer[T any](
	wf interfaces.FuncIter[T],
) AsyncSerializer[T]

func (AsyncSerializer[T]) Do

func (s AsyncSerializer[T]) Do(e T) (err error)

func (AsyncSerializer[T]) Wait

func (s AsyncSerializer[T]) Wait() (err error)

type AtLeastOnce

type AtLeastOnce[T any] struct {
	// contains filtered or unexported fields
}

func (*AtLeastOnce[T]) Do

func (alo *AtLeastOnce[T]) Do(_ T) (err error)

func (*AtLeastOnce[T]) WasAtLeastOnce

func (alo *AtLeastOnce[T]) WasAtLeastOnce() bool

type Slice

type Slice[E any] []E

TODO move to own package

func (Slice[E]) All

func (s Slice[E]) All() iter.Seq[E]

func (Slice[E]) Any

func (s Slice[E]) Any() (e E)

func (*Slice[E]) Append

func (s *Slice[E]) Append(element ...E)

func (Slice[E]) Each

func (s Slice[E]) Each(f interfaces.FuncIter[E]) error

func (Slice[E]) Len

func (s Slice[E]) Len() int

type SortCompare

type SortCompare interface {
	Less() bool
	Equal() bool
	Greater() bool
	// contains filtered or unexported methods
}

type StringerKeyer

type StringerKeyer[
	T interfaces.Stringer,
] struct{}

func (StringerKeyer[T]) GetKey

func (sk StringerKeyer[T]) GetKey(e T) string

func (StringerKeyer[T]) RegisterGob

func (sk StringerKeyer[T]) RegisterGob() StringerKeyer[T]

type StringerKeyerPtr

type StringerKeyerPtr[
	T interfaces.Stringer,
	TPtr interface {
		interfaces.Ptr[T]
		interfaces.Stringer
	},
] struct{}

func (StringerKeyerPtr[T, TPtr]) GetKey

func (sk StringerKeyerPtr[T, TPtr]) GetKey(e T) string

func (StringerKeyerPtr[T, TPtr]) GetKeyPtr

func (sk StringerKeyerPtr[T, TPtr]) GetKeyPtr(e TPtr) string

func (StringerKeyerPtr[T, TPtr]) RegisterGob

func (sk StringerKeyerPtr[T, TPtr]) RegisterGob() StringerKeyerPtr[T, TPtr]

Jump to

Keyboard shortcuts

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