iter

package
v0.0.0-...-1c9a7a8 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddClone

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

func AddClonePool

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

func AddIfGreater

func AddIfGreater[E schnittstellen.Lessor[E]](
	c AddGetKeyer[E],
	e E,
) (ok bool)

func AddOrReplaceIfGreater

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

func AddString

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

func AddStringPtr

func AddStringPtr[E any, EPtr schnittstellen.SetterPtr[E]](
	c schnittstellen.AdderPtr[E, EPtr],
	p schnittstellen.Pool[E, EPtr],
	v string,
) (err error)

func AddStringToBuilder

func AddStringToBuilder[T schnittstellen.Value[T]](
	sb *strings.Builder,
) schnittstellen.FuncIter[T]

func All

func All[T any](c schnittstellen.Collection[T], f func(T) bool) bool

func CheckAny

func CheckAny[T any](c schnittstellen.Collection[T], f func(T) bool) bool

func CheckAnyOrFalseEmpty

func CheckAnyOrFalseEmpty[T any](
	c schnittstellen.Collection[T],
	f func(T) bool,
) bool

func CheckAnyOrTrueEmpty

func CheckAnyOrTrueEmpty[T any](
	c schnittstellen.Collection[T],
	f func(T) bool,
) bool

func CheckAnyPtr

func CheckAnyPtr[
	T any,
	TPtr schnittstellen.Ptr[T],
](
	c schnittstellen.CollectionPtr[T, TPtr],
	f func(TPtr) bool,
) bool

func DerivedValues

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

func DerivedValuesPtr

func DerivedValuesPtr[E any, EPtr schnittstellen.Ptr[E], F any](
	c schnittstellen.SetPtrLike[E, EPtr],
	f schnittstellen.FuncTransform[EPtr, F],
) (out []F, err error)

func Elements

func Elements[T any](s schnittstellen.Iterable[T]) (out []T)

func ErrorWaitGroupApply

func ErrorWaitGroupApply[T any](
	wg ErrorWaitGroup,
	s schnittstellen.SetLike[T],
	f schnittstellen.FuncIter[T],
) (d bool)

func ExpandAndAddString

func ExpandAndAddString[E any, EPtr schnittstellen.SetterPtr[E]](
	c schnittstellen.Adder[E],
	expander func(string) (string, error),
	v string,
) (err error)

func IsErrFalse

func IsErrFalse(err error) bool

func IsErrTrue

func IsErrTrue(err error) bool

func IsStopIteration

func IsStopIteration(err error) bool

func Len

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

func MakeAddClonePoolFunc

func MakeAddClonePoolFunc[E any, EPtr schnittstellen.Ptr[E]](
	s schnittstellen.AdderPtr[E, EPtr],
	p schnittstellen.Pool[E, EPtr],
	r schnittstellen.Resetter2[E, EPtr],
) schnittstellen.FuncIter[EPtr]

func MakeChain

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

func MakeErrStopIteration

func MakeErrStopIteration() error

func MakeFuncIterNoOp

func MakeFuncIterNoOp[T any]() schnittstellen.FuncIter[T]

func MakeFuncSetString

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

func MakeFuncTransformer

func MakeFuncTransformer[T any, T1 any](
	wf schnittstellen.FuncIter[T],
) schnittstellen.FuncIter[T1]

func MakeSyncSerializer

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

func Multiplex

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

func ResetMap

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

func ResetMutableSetWithPool

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

func ReverseSortable

func ReverseSortable(s sort.Interface)

func SetEquals

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

func SetEqualsPtr

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

func SortedStrings

func SortedStrings[E schnittstellen.Stringer](
	cs ...schnittstellen.SetLike[E],
) (out []string)

func SortedValues

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

func SortedValuesBy

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

func StringCommaSeparated

func StringCommaSeparated[E schnittstellen.Value[E]](
	cs ...schnittstellen.SetLike[E],
) string

func StringDelimiterSeparated

func StringDelimiterSeparated[E schnittstellen.Value[E]](
	d string,
	cs ...schnittstellen.SetLike[E],
) string

func Strings

func Strings[E schnittstellen.Stringer](
	cs ...schnittstellen.SetLike[E],
) (out []string)

Types

type AddGetKeyer

type AddGetKeyer[E schnittstellen.Lessor[E]] interface {
	schnittstellen.Adder[E]
	Get(string) (E, bool)
	Key(E) string
}

type AsyncSerializer

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

func MakeAsyncSerializer

func MakeAsyncSerializer[T any](
	wf schnittstellen.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 ErrorWaitGroup

type ErrorWaitGroup interface {
	Do(schnittstellen.FuncError) bool
	DoAfter(schnittstellen.FuncError)
	GetError() error
}

func MakeErrorWaitGroup

func MakeErrorWaitGroup() ErrorWaitGroup

type StringerKeyer

type StringerKeyer[
	T schnittstellen.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 schnittstellen.Stringer,
	TPtr interface {
		schnittstellen.Ptr[T]
		schnittstellen.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