Versions in this module Expand all Collapse all v0 v0.6.1 Jun 10, 2024 v0.6.0 Jun 7, 2024 v0.5.2 May 4, 2024 Changes in this version + type Envelope struct + P O + T *T + func Seal[T any, O Numeric](t *T) *Envelope[T, O] + func (e Envelope[T, O]) Field() O + func (e Envelope[T, O]) Inc(index *Envelope[T, O], by Envelope[T, O]) *Envelope[T, O] + func (e Envelope[T, O]) Index(i int) *Envelope[T, O] type Observable + func RangePF[T ProxyField[T, O], O Numeric](iterator RangeIteratorPF[T, O], opts ...Option[T]) Observable[T] + type RangeIteratorByProxy struct + By T + StartAt T + Whilst WhilstFunc[T] + func (i *RangeIteratorByProxy[T, O]) Increment(index *T) *T + func (i *RangeIteratorByProxy[T, O]) Init() error + func (i *RangeIteratorByProxy[T, O]) Start() (*T, error) + func (i *RangeIteratorByProxy[T, O]) Step() O + func (i *RangeIteratorByProxy[T, O]) While(current T) bool v0.5.1 Apr 24, 2024 Changes in this version + var Infinite int64 = -1 + func Assert[T any](ctx context.Context, iterable Iterable[T], asserters ...Asserter[T]) + func JustError[T any](err error) func(opts ...Option[T]) Single[T] + func JustSingle[T any](value T, opts ...Option[T]) func(opts ...Option[T]) Single[T] + func Just[T any](values ...T) func(opts ...Option[T]) Observable[T] + func MaxInitLimitInt() int + func MinInitLimitInt() int + func MustBool[T any](item Item[T]) bool + func MustOpaque[T, O any](item Item[T]) O + func MustTV[T any](item Item[T]) int + func MustWCh[T any](item Item[T]) chan<- Item[T] + func NativeItemLimitComparator[T constraints.Ordered](a, b Item[T]) int + func SendItems[T any](ctx context.Context, ch chan<- Item[T], strategy enums.CloseChannelStrategy, ...) + func TryBool[T any](item Item[T]) (bool, error) + func TryOpaque[T, O any](item Item[T]) (O, error) + func TryTV[T any](item Item[T]) (int, error) + func TryWCh[T any](item Item[T]) (chan<- Item[T], error) + type AssertFunc func(actual AssertResources[T]) + func (f AssertFunc[T]) Check(actual AssertResources[T]) + type AssertPredicate func(actual AssertResources[T]) error + type AssertResources interface + Booleans func() []bool + Errors func() []error + Numbers func() []int + Opaques func() []any + TickValues func() []NumVal + Ticks func() []NumVal + Values func() []T + type Asserter interface + Check func(actual AssertResources[T]) + type BadRangeIteratorError struct + var RangeMissingWhilstError BadRangeIteratorError + func (e BadRangeIteratorError) Error() string + type Calculator interface + Add func(T, T) T + Div func(T, T) T + Inc func(T) T + IsZero func(T) bool + Zero func() T + func Calc[T Numeric]() Calculator[T] + func ItemCalc[T Numeric]() Calculator[T] + type Comparator func(Item[T], Item[T]) int + type CompletedFunc func() + type ContainItems struct + Expected []T + func (a ContainItems[T]) Check(actual AssertResources[T]) + type CustomPredicate struct + Expected AssertPredicate[T] + func (a CustomPredicate[T]) Check(actual AssertResources[T]) + type Disposable context.CancelFunc + type Disposed <-chan struct + type DistributionFunc func(Item[T]) int + type Duration interface + func WithDuration(d time.Duration) Duration + type DynamicDistributionFunc func(Item[T]) string + type ErrFunc func(error) + type ErrorFunc func(error) T + type ErrorToObservable func(error) Observable[T] + type Func func(context.Context, T) (T, error) + type Func2 func(context.Context, Item[T], Item[T]) (T, error) + type FuncN func(...T) T + type GroupedObservable struct + Key string + type HasAnError struct + Expected error + func (a HasAnError[T]) Check(actual AssertResources[T]) + type HasError struct + Expected []error + func (a HasError[T]) Check(actual AssertResources[T]) + type HasFalse struct + func (a HasFalse[T]) Check(actual AssertResources[T]) + type HasItem struct + Expected T + func (a HasItem[T]) Check(actual AssertResources[T]) + type HasItems struct + Expected []T + func (a HasItems[T]) Check(actual AssertResources[T]) + type HasItemsNoOrder struct + Expected []T + func (a HasItemsNoOrder[T]) Check(actual AssertResources[T]) + type HasNoError struct + func (a HasNoError[T]) Check(actual AssertResources[T]) + type HasNumber struct + Expected int + func (a HasNumber[T]) Check(actual AssertResources[T]) + type HasNumbers struct + Expected []T + func (a HasNumbers[T]) Check(actual AssertResources[T]) + type HasNumbersNoOrder struct + Expected []T + func (a HasNumbersNoOrder[T]) Check(actual AssertResources[T]) + type HasTickCount struct + Expected int + func (a HasTickCount[T]) Check(actual AssertResources[T]) + type HasTickValue struct + Expected int + func (a HasTickValue[T]) Check(actual AssertResources[T]) + type HasTickValueCount struct + Expected int + func (a HasTickValueCount[T]) Check(actual AssertResources[T]) + type HasTicks struct + Expected []T + func (a HasTicks[T]) Check(actual AssertResources[T]) + type HasTrue struct + func (a HasTrue[T]) Check(actual AssertResources[T]) + type IllegalInputError struct + func (e IllegalInputError) Error() string + type IndexOutOfBoundError struct + func (e IndexOutOfBoundError) Error() string + type InitLimit func() Item[T] + type IsEmpty struct + func (a IsEmpty[T]) Check(actual AssertResources[T]) + type IsFalse struct + func (a IsFalse[T]) Check(actual AssertResources[T]) + type IsNotEmpty struct + func (a IsNotEmpty[T]) Check(actual AssertResources[T]) + type IsTrue struct + func (a IsTrue[T]) Check(actual AssertResources[T]) + type IsZero func(T) bool + type Item struct + E error + V T + func Bool[T any](b bool) Item[T] + func Error[T any](err error) Item[T] + func False[T any]() Item[T] + func MaxItemInitLimitInt() Item[int] + func MinItemInitLimitInt() Item[int] + func Num[T any](n NumVal) Item[T] + func Of[T any](v T) Item[T] + func Opaque[T any](o any) Item[T] + func TV[T any](tv int) Item[T] + func Tick[T any]() Item[T] + func True[T any]() Item[T] + func WCh[T any](ch any) Item[T] + func Zero[T any]() Item[T] + func (it Item[T]) Bool() bool + func (it Item[T]) Ch() chan<- Item[T] + func (it Item[T]) Desc() string + func (it Item[T]) Disc() enums.ItemDiscriminator + func (it Item[T]) IsBoolean() bool + func (it Item[T]) IsCh() bool + func (it Item[T]) IsError() bool + func (it Item[T]) IsNumber() bool + func (it Item[T]) IsOpaque() bool + func (it Item[T]) IsTick() bool + func (it Item[T]) IsTickValue() bool + func (it Item[T]) IsValue() bool + func (it Item[T]) Num() NumVal + func (it Item[T]) Opaque() any + func (it Item[T]) SendBlocking(ch chan<- Item[T]) + func (it Item[T]) SendContext(ctx context.Context, ch chan<- Item[T]) bool + func (it Item[T]) SendNonBlocking(ch chan<- Item[T]) bool + func (it Item[T]) TV() int + type ItemToObservable func(Item[T]) Observable[T] + type Iterable interface + Observe func(opts ...Option[T]) <-chan Item[T] + type Marshaller func(T) ([]byte, error) + type MissingCalcError struct + func (e MissingCalcError) Error() string + type NextFunc func(Item[T]) + type NumVal = int + func MustNum[T any](item Item[T]) NumVal + func TryNum[T any](item Item[T]) (NumVal, error) + type Numeric interface + type NumericCalc struct + func (c *NumericCalc[T]) Add(a, b T) T + func (c *NumericCalc[T]) Div(a, b T) T + func (c *NumericCalc[T]) Inc(v T) T + func (c *NumericCalc[T]) IsZero(v T) bool + func (c *NumericCalc[T]) Zero() T + type NumericRangeIterator struct + By T + StartAt T + Whilst WhilstFunc[T] + func (i *NumericRangeIterator[T]) Increment(index *T) T + func (i *NumericRangeIterator[T]) Init() error + func (i *NumericRangeIterator[T]) Start() (*T, error) + func (i *NumericRangeIterator[T]) Step() T + func (i *NumericRangeIterator[T]) While(current T) bool + type Observable interface + All func(predicate Predicate[T], opts ...Option[T]) Single[T] + Average func(opts ...Option[T]) Single[T] + BackOffRetry func(backOffCfg backoff.BackOff, opts ...Option[T]) Observable[T] + Connect func(ctx context.Context) (context.Context, Disposable) + Contains func(equal Predicate[T], opts ...Option[T]) Single[T] + Count func(opts ...Option[T]) Single[T] + DefaultIfEmpty func(defaultValue T, opts ...Option[T]) Observable[T] + Distinct func(apply Func[T], opts ...Option[T]) Observable[T] + DistinctUntilChanged func(apply Func[T], comparator Comparator[T], opts ...Option[T]) Observable[T] + DoOnCompleted func(completedFunc CompletedFunc, opts ...Option[T]) Disposed + DoOnError func(errFunc ErrFunc, opts ...Option[T]) Disposed + DoOnNext func(nextFunc NextFunc[T], opts ...Option[T]) Disposed + ElementAt func(index uint, opts ...Option[T]) Single[T] + Error func(opts ...Option[T]) error + Errors func(opts ...Option[T]) []error + Filter func(apply Predicate[T], opts ...Option[T]) Observable[T] + Find func(find Predicate[T], opts ...Option[T]) OptionalSingle[T] + First func(opts ...Option[T]) OptionalSingle[T] + FirstOrDefault func(defaultValue T, opts ...Option[T]) Single[T] + FlatMap func(apply ItemToObservable[T], opts ...Option[T]) Observable[T] + ForEach func(nextFunc NextFunc[T], errFunc ErrFunc, completedFunc CompletedFunc, ...) Disposed + GroupBy func(length int, distribution DistributionFunc[T], opts ...Option[T]) Observable[T] + GroupByDynamic func(distribution DynamicDistributionFunc[T], opts ...Option[T]) Observable[T] + IgnoreElements func(opts ...Option[T]) Observable[T] + Last func(opts ...Option[T]) OptionalSingle[T] + LastOrDefault func(defaultValue T, opts ...Option[T]) Single[T] + Map func(apply Func[T], opts ...Option[T]) Observable[T] + Max func(comparator Comparator[T], initLimit InitLimit[T], opts ...Option[T]) OptionalSingle[T] + Min func(comparator Comparator[T], initLimit InitLimit[T], opts ...Option[T]) OptionalSingle[T] + OnErrorResumeNext func(resumeSequence ErrorToObservable[T], opts ...Option[T]) Observable[T] + OnErrorReturn func(resumeFunc ErrorFunc[T], opts ...Option[T]) Observable[T] + OnErrorReturnItem func(resume T, opts ...Option[T]) Observable[T] + Reduce func(apply Func2[T], opts ...Option[T]) OptionalSingle[T] + Repeat func(count int64, frequency Duration, opts ...Option[T]) Observable[T] + Retry func(count int, shouldRetry ShouldRetryFunc, opts ...Option[T]) Observable[T] + Run func(opts ...Option[T]) Disposed + Sample func(iterable Iterable[T], opts ...Option[T]) Observable[T] + Scan func(apply Func2[T], opts ...Option[T]) Observable[T] + Send func(output chan<- Item[T], opts ...Option[T]) + SequenceEqual func(iterable Iterable[T], comparator Comparator[T], opts ...Option[T]) Single[T] + Serialize func(from int, identifier func(any) int, opts ...Option[T]) Observable[T] + Skip func(nth uint, opts ...Option[T]) Observable[T] + SkipLast func(nth uint, opts ...Option[T]) Observable[T] + SkipWhile func(apply Predicate[T], opts ...Option[T]) Observable[T] + StartWith func(iterable Iterable[T], opts ...Option[T]) Observable[T] + Sum func(opts ...Option[T]) OptionalSingle[T] + Take func(nth uint, opts ...Option[T]) Observable[T] + TakeLast func(nth uint, opts ...Option[T]) Observable[T] + TakeUntil func(apply Predicate[T], opts ...Option[T]) Observable[T] + TakeWhile func(apply Predicate[T], opts ...Option[T]) Observable[T] + TimeInterval func(opts ...Option[T]) Observable[T] + Timestamp func(opts ...Option[T]) Observable[T] + ToSlice func(initialCapacity int, opts ...Option[T]) ([]Item[T], error) + WindowWithCount func(count int, opts ...Option[T]) Observable[T] + WindowWithTime func(timespan Duration, opts ...Option[T]) Observable[T] + WindowWithTimeOrCount func(timespan Duration, count int, opts ...Option[T]) Observable[T] + ZipFromIterable func(iterable Iterable[T], zipper Func2[T], opts ...Option[T]) Observable[T] + func Amb[T any](observables []Observable[T], opts ...Option[T]) Observable[T] + func CombineLatest[T any](f FuncN[T], observables []Observable[T], opts ...Option[T]) Observable[T] + func Concat[T any](observables []Observable[T], opts ...Option[T]) Observable[T] + func Create[T any](f []Producer[T], opts ...Option[T]) Observable[T] + func Defer[T any](f []Producer[T], opts ...Option[T]) Observable[T] + func Empty[T any]() Observable[T] + func FromChannel[T any](next <-chan Item[T], opts ...Option[T]) Observable[T] + func FromEventSource[T any](next <-chan Item[T], opts ...Option[T]) Observable[T] + func Interval[T any](interval Duration, opts ...Option[T]) Observable[T] + func Merge[T any](observables []Observable[T], opts ...Option[T]) Observable[T] + func Never[T any]() Observable[T] + func RangeNF[T ProxyField[T, O], O Numeric](iterator RangeIteratorPF[T, O], opts ...Option[T]) Observable[T] + func Range[T Numeric](iterator RangeIterator[T], opts ...Option[T]) Observable[T] + func Start[T any](fs []Supplier[T], opts ...Option[T]) Observable[T] + func Thrown[T any](err error) Observable[T] + func Timer[T any](d Duration, opts ...Option[T]) Observable[T] + type ObservableImpl struct + func (o *ObservableImpl[T]) All(predicate Predicate[T], opts ...Option[T]) Single[T] + func (o *ObservableImpl[T]) Average(opts ...Option[T]) Single[T] + func (o *ObservableImpl[T]) BackOffRetry(backOffCfg backoff.BackOff, opts ...Option[T]) Observable[T] + func (o *ObservableImpl[T]) Connect(ctx context.Context) (context.Context, Disposable) + func (o *ObservableImpl[T]) Contains(equal Predicate[T], opts ...Option[T]) Single[T] + func (o *ObservableImpl[T]) Count(opts ...Option[T]) Single[T] + func (o *ObservableImpl[T]) DefaultIfEmpty(defaultValue T, opts ...Option[T]) Observable[T] + func (o *ObservableImpl[T]) Distinct(apply Func[T], opts ...Option[T]) Observable[T] + func (o *ObservableImpl[T]) DistinctUntilChanged(apply Func[T], comparator Comparator[T], opts ...Option[T]) Observable[T] + func (o *ObservableImpl[T]) DoOnCompleted(completedFunc CompletedFunc, opts ...Option[T]) Disposed + func (o *ObservableImpl[T]) DoOnError(errFunc ErrFunc, opts ...Option[T]) Disposed + func (o *ObservableImpl[T]) DoOnNext(nextFunc NextFunc[T], opts ...Option[T]) Disposed + func (o *ObservableImpl[T]) ElementAt(index uint, opts ...Option[T]) Single[T] + func (o *ObservableImpl[T]) Error(opts ...Option[T]) error + func (o *ObservableImpl[T]) Errors(opts ...Option[T]) []error + func (o *ObservableImpl[T]) Filter(apply Predicate[T], opts ...Option[T]) Observable[T] + func (o *ObservableImpl[T]) Find(find Predicate[T], opts ...Option[T]) OptionalSingle[T] + func (o *ObservableImpl[T]) First(opts ...Option[T]) OptionalSingle[T] + func (o *ObservableImpl[T]) FirstOrDefault(defaultValue T, opts ...Option[T]) Single[T] + func (o *ObservableImpl[T]) FlatMap(apply ItemToObservable[T], opts ...Option[T]) Observable[T] + func (o *ObservableImpl[T]) ForEach(nextFunc NextFunc[T], errFunc ErrFunc, completedFunc CompletedFunc, ...) Disposed + func (o *ObservableImpl[T]) GroupBy(length int, distribution DistributionFunc[T], opts ...Option[T]) Observable[T] + func (o *ObservableImpl[T]) GroupByDynamic(distribution DynamicDistributionFunc[T], opts ...Option[T]) Observable[T] + func (o *ObservableImpl[T]) IgnoreElements(opts ...Option[T]) Observable[T] + func (o *ObservableImpl[T]) Last(opts ...Option[T]) OptionalSingle[T] + func (o *ObservableImpl[T]) LastOrDefault(defaultValue T, opts ...Option[T]) Single[T] + func (o *ObservableImpl[T]) Map(apply Func[T], opts ...Option[T]) Observable[T] + func (o *ObservableImpl[T]) Max(comparator Comparator[T], initLimit InitLimit[T], opts ...Option[T]) OptionalSingle[T] + func (o *ObservableImpl[T]) Min(comparator Comparator[T], initLimit InitLimit[T], opts ...Option[T]) OptionalSingle[T] + func (o *ObservableImpl[T]) Observe(opts ...Option[T]) <-chan Item[T] + func (o *ObservableImpl[T]) OnErrorResumeNext(resumeSequence ErrorToObservable[T], opts ...Option[T]) Observable[T] + func (o *ObservableImpl[T]) OnErrorReturn(resumeFunc ErrorFunc[T], opts ...Option[T]) Observable[T] + func (o *ObservableImpl[T]) OnErrorReturnItem(resume T, opts ...Option[T]) Observable[T] + func (o *ObservableImpl[T]) Reduce(apply Func2[T], opts ...Option[T]) OptionalSingle[T] + func (o *ObservableImpl[T]) Repeat(count int64, frequency Duration, opts ...Option[T]) Observable[T] + func (o *ObservableImpl[T]) Retry(count int, shouldRetry ShouldRetryFunc, opts ...Option[T]) Observable[T] + func (o *ObservableImpl[T]) Run(opts ...Option[T]) Disposed + func (o *ObservableImpl[T]) Sample(iterable Iterable[T], opts ...Option[T]) Observable[T] + func (o *ObservableImpl[T]) Scan(apply Func2[T], opts ...Option[T]) Observable[T] + func (o *ObservableImpl[T]) Send(output chan<- Item[T], opts ...Option[T]) + func (o *ObservableImpl[T]) SequenceEqual(iterable Iterable[T], comparator Comparator[T], opts ...Option[T]) Single[T] + func (o *ObservableImpl[T]) Serialize(from int, identifier func(any) int, opts ...Option[T]) Observable[T] + func (o *ObservableImpl[T]) Skip(nth uint, opts ...Option[T]) Observable[T] + func (o *ObservableImpl[T]) SkipLast(nth uint, opts ...Option[T]) Observable[T] + func (o *ObservableImpl[T]) SkipWhile(apply Predicate[T], opts ...Option[T]) Observable[T] + func (o *ObservableImpl[T]) StartWith(iterable Iterable[T], opts ...Option[T]) Observable[T] + func (o *ObservableImpl[T]) Sum(opts ...Option[T]) OptionalSingle[T] + func (o *ObservableImpl[T]) Take(nth uint, opts ...Option[T]) Observable[T] + func (o *ObservableImpl[T]) TakeLast(nth uint, opts ...Option[T]) Observable[T] + func (o *ObservableImpl[T]) TakeUntil(apply Predicate[T], opts ...Option[T]) Observable[T] + func (o *ObservableImpl[T]) TakeWhile(apply Predicate[T], opts ...Option[T]) Observable[T] + func (o *ObservableImpl[T]) TimeInterval(opts ...Option[T]) Observable[T] + func (o *ObservableImpl[T]) Timestamp(opts ...Option[T]) Observable[T] + func (o *ObservableImpl[T]) ToSlice(initialCapacity int, opts ...Option[T]) ([]Item[T], error) + func (o *ObservableImpl[T]) WindowWithCount(count int, opts ...Option[T]) Observable[T] + func (o *ObservableImpl[T]) WindowWithTime(timespan Duration, opts ...Option[T]) Observable[T] + func (o *ObservableImpl[T]) WindowWithTimeOrCount(timespan Duration, count int, opts ...Option[T]) Observable[T] + func (o *ObservableImpl[T]) ZipFromIterable(iterable Iterable[T], zipper Func2[T], opts ...Option[T]) Observable[T] + type Option interface + func Serialize[T any](identifier func(T) int) Option[T] + func WithBackPressureStrategy[T any](strategy enums.BackPressureStrategy) Option[T] + func WithBufferedChannel[T any](capacity int) Option[T] + func WithCPUPool[T any]() Option[T] + func WithCalc[T any](calculator Calculator[T]) Option[T] + func WithContext[T any](ctx context.Context) Option[T] + func WithErrorStrategy[T any](strategy enums.OnErrorStrategy) Option[T] + func WithObservationStrategy[T any](strategy enums.ObservationStrategy) Option[T] + func WithPool[T any](pool int) Option[T] + func WithPublishStrategy[T any]() Option[T] + type OptionalSingle interface + Get func(opts ...Option[T]) (Item[T], error) + Map func(apply Func[T], opts ...Option[T]) OptionalSingle[T] + Run func(opts ...Option[T]) Disposed + type OptionalSingleImpl struct + func NewOptionalSingleImpl[T any](iterable Iterable[T]) OptionalSingleImpl[T] + func (o *OptionalSingleImpl[T]) Get(opts ...Option[T]) (Item[T], error) + func (o *OptionalSingleImpl[T]) Map(apply Func[T], opts ...Option[T]) OptionalSingle[T] + func (o *OptionalSingleImpl[T]) Observe(opts ...Option[T]) <-chan Item[T] + func (o *OptionalSingleImpl[T]) Run(opts ...Option[T]) Disposed + type Predicate func(Item[T]) bool + type Producer func(ctx context.Context, next chan<- Item[T]) + type ProxyField interface + Field func() O + Inc func(index *T, by T) *T + Index func(i int) *T + type ProxyRangeIterator struct + By T + StartAt T + Whilst WhilstFunc[T] + func (i *ProxyRangeIterator[T, O]) Increment(index *T) *T + func (i *ProxyRangeIterator[T, O]) Init() error + func (i *ProxyRangeIterator[T, O]) Start() (*T, error) + func (i *ProxyRangeIterator[T, O]) Step() O + func (i *ProxyRangeIterator[T, O]) While(current T) bool + type RangeIterator interface + Increment func(index *T) T + Init func() error + Start func() (*T, error) + Step func() T + While func(current T) bool + type RangeIteratorPF interface + Increment func(index *T) *T + Init func() error + Start func() (*T, error) + Step func() O + While func(current T) bool + type ShouldRetryFunc func(error) bool + type Single interface + Filter func(apply Predicate[T], opts ...Option[T]) OptionalSingle[T] + Get func(opts ...Option[T]) (Item[T], error) + Map func(apply Func[T], opts ...Option[T]) Single[T] + Run func(opts ...Option[T]) Disposed + func JustItem[T any](value T, opts ...Option[T]) Single[T] + type SingleImpl struct + func (s *SingleImpl[T]) Filter(apply Predicate[T], opts ...Option[T]) OptionalSingle[T] + func (s *SingleImpl[T]) Get(opts ...Option[T]) (Item[T], error) + func (s *SingleImpl[T]) Map(apply Func[T], opts ...Option[T]) Single[T] + func (s *SingleImpl[T]) Observe(opts ...Option[T]) <-chan Item[T] + func (s *SingleImpl[T]) Run(opts ...Option[T]) Disposed + type Supplier func(ctx context.Context) Item[T] + type TimestampItem struct + Timestamp time.Time + V T + type TryError struct + func (e TryError[T]) Error() string + type Unmarshaller func([]byte, T) error + type WhilstFunc func(current T) bool + func Count[T Numeric](count T) WhilstFunc[T] + func LessThanPF[T ProxyField[T, O], O Numeric](until T) WhilstFunc[T] + func LessThan[T Numeric](until T) WhilstFunc[T] + func MoreThanPF[T ProxyField[T, O], O Numeric](until T) WhilstFunc[T] + func MoreThan[T Numeric](until T) WhilstFunc[T]