Documentation ¶
Index ¶
- Constants
- func Chan(inp ...error) chan error
- func ChanErrorS(inp ...[]error) chan []error
- func ChanErrorSFuncErr(act func() ([]error, error)) <-chan []error
- func ChanErrorSFuncNok(act func() ([]error, bool)) <-chan []error
- func ChanErrorSSlice(inp ...[][]error) chan []error
- func ChanFuncErr(act func() (error, error)) <-chan error
- func ChanFuncNok(act func() (error, bool)) <-chan error
- func ChanSlice(inp ...[]error) chan error
- func Daisy(inp <-chan error, tube Tube) (out <-chan error)
- func DaisyChain(inp <-chan error, tubes ...Tube) (out <-chan error)
- func Done(inp <-chan error) chan struct{}
- func DoneErrorS(inp <-chan []error) chan struct{}
- func DoneErrorSFunc(inp <-chan []error, act func(a []error)) chan struct{}
- func DoneErrorSSlice(inp <-chan []error) chan [][]error
- func DoneFunc(inp <-chan error, act func(a error)) chan struct{}
- func DoneSlice(inp <-chan error) chan []error
- func ErrorSDaisy(inp <-chan []error, tube ErrorSTube) (out <-chan []error)
- func ErrorSDaisyChain(inp <-chan []error, tubes ...ErrorSTube) (out <-chan []error)
- func Join(out chan<- error, inp ...error) chan struct{}
- func JoinChan(out chan<- error, inp <-chan error) chan struct{}
- func JoinErrorS(out chan<- []error, inp ...[]error) chan struct{}
- func JoinErrorSChan(out chan<- []error, inp <-chan []error) chan struct{}
- func JoinErrorSSlice(out chan<- []error, inp ...[][]error) chan struct{}
- func JoinSlice(out chan<- error, inp ...[]error) chan struct{}
- func MakeChan() chan error
- func MakeErrorSChan() chan []error
- func PipeBuffer(inp <-chan error, cap int) chan error
- func PipeErrorSBuffer(inp <-chan []error, cap int) chan []error
- func PipeErrorSFork(inp <-chan []error) (chan []error, chan []error)
- func PipeErrorSFunc(inp <-chan []error, act func(a []error) []error) chan []error
- func PipeFork(inp <-chan error) (chan error, chan error)
- func PipeFunc(inp <-chan error, act func(a error) error) chan error
- func SendProxy(out chan<- error) chan<- error
- func SendProxyErrorS(out chan<- []error) chan<- []error
- type ErrorSTube
- type Tube
Constants ¶
const CAP = 10
CAP is the capacity of the buffered proxy channel
const ErrorSCAP = 10
ErrorSCAP is the capacity of the buffered proxy channel
const ErrorSQUE = 16
ErrorSQUE is the allocated size of the circular queue
const QUE = 16
QUE is the allocated size of the circular queue
Variables ¶
This section is empty.
Functions ¶
func ChanErrorS ¶
ChanErrorS returns a channel to receive all inputs before close.
func ChanErrorSFuncErr ¶
ChanErrorSFuncErr returns a channel to receive all results of act until err != nil before close.
func ChanErrorSFuncNok ¶
ChanErrorSFuncNok returns a channel to receive all results of act until nok before close.
func ChanErrorSSlice ¶
ChanErrorSSlice returns a channel to receive all inputs before close.
func ChanFuncErr ¶
ChanFuncErr returns a channel to receive all results of act until err != nil before close.
func ChanFuncNok ¶
ChanFuncNok returns a channel to receive all results of act until nok before close.
func DaisyChain ¶
DaisyChain returns a channel to receive all inp after having passed thru all tubes.
func Done ¶
func Done(inp <-chan error) chan struct{}
Done returns a channel to receive one signal before close after inp has been drained.
func DoneErrorS ¶
func DoneErrorS(inp <-chan []error) chan struct{}
DoneErrorS returns a channel to receive one signal before close after inp has been drained.
func DoneErrorSFunc ¶
DoneErrorSFunc returns a channel to receive one signal before close after act has been applied to all inp.
func DoneErrorSSlice ¶
DoneErrorSSlice returns a channel which will receive a slice of all the ErrorSs received on inp channel before close. Unlike DoneErrorS, a full slice is sent once, not just an event.
func DoneFunc ¶
DoneFunc returns a channel to receive one signal before close after act has been applied to all inp.
func DoneSlice ¶
DoneSlice returns a channel which will receive a slice of all the s received on inp channel before close. Unlike Done, a full slice is sent once, not just an event.
func ErrorSDaisy ¶
func ErrorSDaisy(inp <-chan []error, tube ErrorSTube) (out <-chan []error)
ErrorSDaisy returns a channel to receive all inp after having passed thru tube.
func ErrorSDaisyChain ¶
func ErrorSDaisyChain(inp <-chan []error, tubes ...ErrorSTube) (out <-chan []error)
ErrorSDaisyChain returns a channel to receive all inp after having passed thru all tubes.
func Join ¶
Join sends inputs on the given out channel and returns a done channel to receive one signal when inp has been drained
func JoinChan ¶
JoinChan sends inputs on the given out channel and returns a done channel to receive one signal when inp has been drained
func JoinErrorS ¶
JoinErrorS sends inputs on the given out channel and returns a done channel to receive one signal when inp has been drained
func JoinErrorSChan ¶
JoinErrorSChan sends inputs on the given out channel and returns a done channel to receive one signal when inp has been drained
func JoinErrorSSlice ¶
JoinErrorSSlice sends inputs on the given out channel and returns a done channel to receive one signal when inp has been drained
func JoinSlice ¶
JoinSlice sends inputs on the given out channel and returns a done channel to receive one signal when inp has been drained
func MakeChan ¶
func MakeChan() chan error
MakeChan returns a new open channel (simply a 'chan error' that is).
Note: No '-producer' is launched here yet! (as is in all the other functions).
This is useful to easily create corresponding variables such as
var myPipelineStartsHere := MakeChan() // ... lot's of code to design and build Your favourite "myWorkflowPipeline" // ... // ... *before* You start pouring data into it, e.g. simply via: for drop := range water { myPipelineStartsHere <- drop } close(myPipelineStartsHere)
Hint: especially helpful, if Your piping library operates on some hidden (non-exported) type (or on a type imported from elsewhere - and You don't want/need or should(!) have to care.)
Note: as always (except for PipeBuffer) the channel is unbuffered.
func MakeErrorSChan ¶
func MakeErrorSChan() chan []error
MakeErrorSChan returns a new open channel (simply a 'chan []error' that is).
Note: No 'ErrorS-producer' is launched here yet! (as is in all the other functions).
This is useful to easily create corresponding variables such as
var myErrorSPipelineStartsHere := MakeErrorSChan() // ... lot's of code to design and build Your favourite "myErrorSWorkflowPipeline" // ... // ... *before* You start pouring data into it, e.g. simply via: for drop := range water { myErrorSPipelineStartsHere <- drop } close(myErrorSPipelineStartsHere)
Hint: especially helpful, if Your piping library operates on some hidden (non-exported) type (or on a type imported from elsewhere - and You don't want/need or should(!) have to care.)
Note: as always (except for PipeErrorSBuffer) the channel is unbuffered.
func PipeBuffer ¶
PipeBuffer returns a buffered channel with capacity cap to receive all inp before close.
func PipeErrorSBuffer ¶
PipeErrorSBuffer returns a buffered channel with capacity cap to receive all inp before close.
func PipeErrorSFork ¶
PipeErrorSFork returns two channels to receive every result of inp before close.
Note: Yes, it is a VERY simple fanout - but sometimes all You need.
func PipeErrorSFunc ¶
PipeErrorSFunc returns a channel to receive every result of act applied to inp before close. Note: it 'could' be PipeErrorSMap for functional people, but 'map' has a very different meaning in go lang.
func PipeFork ¶
PipeFork returns two channels to receive every result of inp before close.
Note: Yes, it is a VERY simple fanout - but sometimes all You need.
func PipeFunc ¶
PipeFunc returns a channel to receive every result of act applied to inp before close. Note: it 'could' be PipeMap for functional people, but 'map' has a very different meaning in go lang.
func SendProxy ¶
SendProxy returns a channel to serve as a sending proxy to 'out'. Uses a goroutine to receive values from 'out' and store them in an expanding buffer, so that sending to 'out' never blocks.
Note: the expanding buffer is implemented via "container/ring"
func SendProxyErrorS ¶
SendProxyErrorS returns a channel to serve as a sending proxy to 'out'. Uses a goroutine to receive values from 'out' and store them in an expanding buffer, so that sending to 'out' never blocks.
Note: the expanding buffer is implemented via "container/ring"
Types ¶
type ErrorSTube ¶
ErrorSTube is the signature for a pipe function.