IsError

package
v0.0.0-...-5012a73 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2019 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const CAP = 10

CAP is the capacity of the buffered proxy channel

View Source
const ErrorSCAP = 10

ErrorSCAP is the capacity of the buffered proxy channel

View Source
const ErrorSQUE = 16

ErrorSQUE is the allocated size of the circular queue

View Source
const QUE = 16

QUE is the allocated size of the circular queue

Variables

This section is empty.

Functions

func Chan

func Chan(inp ...error) chan error

Chan returns a channel to receive all inputs before close.

func ChanErrorS

func ChanErrorS(inp ...[]error) chan []error

ChanErrorS returns a channel to receive all inputs before close.

func ChanErrorSFuncErr

func ChanErrorSFuncErr(act func() ([]error, error)) <-chan []error

ChanErrorSFuncErr returns a channel to receive all results of act until err != nil before close.

func ChanErrorSFuncNok

func ChanErrorSFuncNok(act func() ([]error, bool)) <-chan []error

ChanErrorSFuncNok returns a channel to receive all results of act until nok before close.

func ChanErrorSSlice

func ChanErrorSSlice(inp ...[][]error) chan []error

ChanErrorSSlice returns a channel to receive all inputs before close.

func ChanFuncErr

func ChanFuncErr(act func() (error, error)) <-chan error

ChanFuncErr returns a channel to receive all results of act until err != nil before close.

func ChanFuncNok

func ChanFuncNok(act func() (error, bool)) <-chan error

ChanFuncNok returns a channel to receive all results of act until nok before close.

func ChanSlice

func ChanSlice(inp ...[]error) chan error

ChanSlice returns a channel to receive all inputs before close.

func Daisy

func Daisy(inp <-chan error, tube Tube) (out <-chan error)

Daisy returns a channel to receive all inp after having passed thru tube.

func DaisyChain

func DaisyChain(inp <-chan error, tubes ...Tube) (out <-chan error)

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

func DoneErrorSFunc(inp <-chan []error, act func(a []error)) chan struct{}

DoneErrorSFunc returns a channel to receive one signal before close after act has been applied to all inp.

func DoneErrorSSlice

func DoneErrorSSlice(inp <-chan []error) chan [][]error

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

func DoneFunc(inp <-chan error, act func(a error)) chan struct{}

DoneFunc returns a channel to receive one signal before close after act has been applied to all inp.

func DoneSlice

func DoneSlice(inp <-chan error) chan []error

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

func Join(out chan<- error, inp ...error) chan struct{}

Join sends inputs on the given out channel and returns a done channel to receive one signal when inp has been drained

func JoinChan

func JoinChan(out chan<- error, inp <-chan error) chan struct{}

JoinChan sends inputs on the given out channel and returns a done channel to receive one signal when inp has been drained

func JoinErrorS

func JoinErrorS(out chan<- []error, inp ...[]error) chan struct{}

JoinErrorS sends inputs on the given out channel and returns a done channel to receive one signal when inp has been drained

func JoinErrorSChan

func JoinErrorSChan(out chan<- []error, inp <-chan []error) chan struct{}

JoinErrorSChan sends inputs on the given out channel and returns a done channel to receive one signal when inp has been drained

func JoinErrorSSlice

func JoinErrorSSlice(out chan<- []error, inp ...[][]error) chan struct{}

JoinErrorSSlice sends inputs on the given out channel and returns a done channel to receive one signal when inp has been drained

func JoinSlice

func JoinSlice(out chan<- error, inp ...[]error) chan struct{}

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

func PipeBuffer(inp <-chan error, cap int) chan error

PipeBuffer returns a buffered channel with capacity cap to receive all inp before close.

func PipeErrorSBuffer

func PipeErrorSBuffer(inp <-chan []error, cap int) chan []error

PipeErrorSBuffer returns a buffered channel with capacity cap to receive all inp before close.

func PipeErrorSFork

func PipeErrorSFork(inp <-chan []error) (chan []error, chan []error)

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

func PipeErrorSFunc(inp <-chan []error, act func(a []error) []error) chan []error

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

func PipeFork(inp <-chan error) (chan error, chan error)

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

func PipeFunc(inp <-chan error, act func(a error) error) chan error

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

func SendProxy(out chan<- error) chan<- error

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

func SendProxyErrorS(out chan<- []error) chan<- []error

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

type ErrorSTube func(inp <-chan []error, out <-chan []error)

ErrorSTube is the signature for a pipe function.

type Tube

type Tube func(inp <-chan error, out <-chan error)

Tube is the signature for a pipe function.

Jump to

Keyboard shortcuts

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