channels

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BrokenSinkError

func BrokenSinkError() error

Types

type ChanElem

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

func WrapChanData

func WrapChanData[T any](data T) ChanElem[T]

func WrapChanErr

func WrapChanErr[T any](err error) ChanElem[T]

func (*ChanElem[T]) Data

func (e *ChanElem[T]) Data() T

func (*ChanElem[T]) Err

func (e *ChanElem[T]) Err() error

func (*ChanElem[T]) SendTo

func (e *ChanElem[T]) SendTo(ch chan<- ChanElem[T], context context.Context) bool

type StreamingChan

type StreamingChan[T any] <-chan ChanElem[T]

func CreateChannel

func CreateChannel[T any](generator func(sink func(data T, context context.Context) bool) error) StreamingChan[T]

func CreateChannelBuffered

func CreateChannelBuffered[T any](bufSize int, generator func(sink func(data []T, context context.Context) bool) error) StreamingChan[T]

func FlapMap

func FlapMap[P any, Q any](ch StreamingChan[P], mapper func(data P) StreamingChan[Q]) StreamingChan[Q]

func Map

func Map[P any, Q any](ch StreamingChan[P], mapper func(data P) Q) StreamingChan[Q]

func SingleElemChannel

func SingleElemChannel[T any](data T) StreamingChan[T]

func SingleElemChannelErr

func SingleElemChannelErr[T any](data T, err error) StreamingChan[T]

func SliceToChannel

func SliceToChannel[T any](data []T) StreamingChan[T]

func (StreamingChan[T]) CollectToSlice

func (ch StreamingChan[T]) CollectToSlice() ([]T, error)

func (StreamingChan[T]) FlatMap

func (ch StreamingChan[T]) FlatMap(mapper func(data T) StreamingChan[any]) StreamingChan[any]

func (StreamingChan[T]) ForEachChanElem

func (ch StreamingChan[T]) ForEachChanElem(onEach func(data T) error) error

func (StreamingChan[T]) Map

func (ch StreamingChan[T]) Map(mapper func(data T) any) StreamingChan[any]

Jump to

Keyboard shortcuts

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