test

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 PointerCAP = 10

PointerCAP is the capacity of the buffered proxy channel

View Source
const PointerQUE = 16

PointerQUE is the allocated size of the circular queue

View Source
const PointerSCAP = 10

PointerSCAP is the capacity of the buffered proxy channel

View Source
const PointerSQUE = 16

PointerSQUE is the allocated size of the circular queue

View Source
const SomeTypeCAP = 10

SomeTypeCAP is the capacity of the buffered proxy channel

View Source
const SomeTypeQUE = 16

SomeTypeQUE is the allocated size of the circular queue

View Source
const SomeTypeSCAP = 10

SomeTypeSCAP is the capacity of the buffered proxy channel

View Source
const SomeTypeSQUE = 16

SomeTypeSQUE is the allocated size of the circular queue

Variables

This section is empty.

Functions

func ChanPointer

func ChanPointer(inp ...*SomeType) (out <-chan *SomeType)

ChanPointer returns a channel to receive all inputs before close.

func ChanPointerFuncErr

func ChanPointerFuncErr(act func() (*SomeType, error)) (out <-chan *SomeType)

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

func ChanPointerFuncNok

func ChanPointerFuncNok(act func() (*SomeType, bool)) (out <-chan *SomeType)

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

func ChanPointerS

func ChanPointerS(inp ...[]*SomeType) (out <-chan []*SomeType)

ChanPointerS returns a channel to receive all inputs before close.

func ChanPointerSFuncErr

func ChanPointerSFuncErr(act func() ([]*SomeType, error)) (out <-chan []*SomeType)

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

func ChanPointerSFuncNok

func ChanPointerSFuncNok(act func() ([]*SomeType, bool)) (out <-chan []*SomeType)

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

func ChanPointerSSlice

func ChanPointerSSlice(inp ...[][]*SomeType) (out <-chan []*SomeType)

ChanPointerSSlice returns a channel to receive all inputs before close.

func ChanPointerSlice

func ChanPointerSlice(inp ...[]*SomeType) (out <-chan *SomeType)

ChanPointerSlice returns a channel to receive all inputs before close.

func ChanSomeType

func ChanSomeType(inp ...SomeType) (out <-chan SomeType)

ChanSomeType returns a channel to receive all inputs before close.

func ChanSomeTypeFuncErr

func ChanSomeTypeFuncErr(act func() (SomeType, error)) (out <-chan SomeType)

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

func ChanSomeTypeFuncNok

func ChanSomeTypeFuncNok(act func() (SomeType, bool)) (out <-chan SomeType)

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

func ChanSomeTypeS

func ChanSomeTypeS(inp ...[]SomeType) (out <-chan []SomeType)

ChanSomeTypeS returns a channel to receive all inputs before close.

func ChanSomeTypeSFuncErr

func ChanSomeTypeSFuncErr(act func() ([]SomeType, error)) (out <-chan []SomeType)

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

func ChanSomeTypeSFuncNok

func ChanSomeTypeSFuncNok(act func() ([]SomeType, bool)) (out <-chan []SomeType)

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

func ChanSomeTypeSSlice

func ChanSomeTypeSSlice(inp ...[][]SomeType) (out <-chan []SomeType)

ChanSomeTypeSSlice returns a channel to receive all inputs before close.

func ChanSomeTypeSlice

func ChanSomeTypeSlice(inp ...[]SomeType) (out <-chan SomeType)

ChanSomeTypeSlice returns a channel to receive all inputs before close.

func DonePointer

func DonePointer(inp <-chan *SomeType) (done <-chan struct{})

DonePointer returns a channel to receive one signal before close after inp has been drained.

func DonePointerFunc

func DonePointerFunc(inp <-chan *SomeType, act func(a *SomeType)) (out <-chan struct{})

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

func DonePointerS

func DonePointerS(inp <-chan []*SomeType) (done <-chan struct{})

DonePointerS returns a channel to receive one signal before close after inp has been drained.

func DonePointerSFunc

func DonePointerSFunc(inp <-chan []*SomeType, act func(a []*SomeType)) (out <-chan struct{})

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

func DonePointerSSlice

func DonePointerSSlice(inp <-chan []*SomeType) (done <-chan [][]*SomeType)

DonePointerSSlice returns a channel which will receive a slice of all the PointerSs received on inp channel before close. Unlike DonePointerS, a full slice is sent once, not just an event.

func DonePointerSlice

func DonePointerSlice(inp <-chan *SomeType) (done <-chan []*SomeType)

DonePointerSlice returns a channel which will receive a slice of all the Pointers received on inp channel before close. Unlike DonePointer, a full slice is sent once, not just an event.

func DoneSomeType

func DoneSomeType(inp <-chan SomeType) (done <-chan struct{})

DoneSomeType returns a channel to receive one signal before close after inp has been drained.

func DoneSomeTypeFunc

func DoneSomeTypeFunc(inp <-chan SomeType, act func(a SomeType)) (out <-chan struct{})

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

func DoneSomeTypeS

func DoneSomeTypeS(inp <-chan []SomeType) (done <-chan struct{})

DoneSomeTypeS returns a channel to receive one signal before close after inp has been drained.

func DoneSomeTypeSFunc

func DoneSomeTypeSFunc(inp <-chan []SomeType, act func(a []SomeType)) (out <-chan struct{})

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

func DoneSomeTypeSSlice

func DoneSomeTypeSSlice(inp <-chan []SomeType) (done <-chan [][]SomeType)

DoneSomeTypeSSlice returns a channel which will receive a slice of all the SomeTypeSs received on inp channel before close. Unlike DoneSomeTypeS, a full slice is sent once, not just an event.

func DoneSomeTypeSlice

func DoneSomeTypeSlice(inp <-chan SomeType) (done <-chan []SomeType)

DoneSomeTypeSlice returns a channel which will receive a slice of all the SomeTypes received on inp channel before close. Unlike DoneSomeType, a full slice is sent once, not just an event.

func JoinPointer

func JoinPointer(out chan<- *SomeType, inp ...*SomeType) (done <-chan struct{})

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

func JoinPointerChan

func JoinPointerChan(out chan<- *SomeType, inp <-chan *SomeType) (done <-chan struct{})

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

func JoinPointerS

func JoinPointerS(out chan<- []*SomeType, inp ...[]*SomeType) (done <-chan struct{})

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

func JoinPointerSChan

func JoinPointerSChan(out chan<- []*SomeType, inp <-chan []*SomeType) (done <-chan struct{})

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

func JoinPointerSSlice

func JoinPointerSSlice(out chan<- []*SomeType, inp ...[][]*SomeType) (done <-chan struct{})

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

func JoinPointerSlice

func JoinPointerSlice(out chan<- *SomeType, inp ...[]*SomeType) (done <-chan struct{})

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

func JoinSomeType

func JoinSomeType(out chan<- SomeType, inp ...SomeType) (done <-chan struct{})

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

func JoinSomeTypeChan

func JoinSomeTypeChan(out chan<- SomeType, inp <-chan SomeType) (done <-chan struct{})

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

func JoinSomeTypeS

func JoinSomeTypeS(out chan<- []SomeType, inp ...[]SomeType) (done <-chan struct{})

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

func JoinSomeTypeSChan

func JoinSomeTypeSChan(out chan<- []SomeType, inp <-chan []SomeType) (done <-chan struct{})

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

func JoinSomeTypeSSlice

func JoinSomeTypeSSlice(out chan<- []SomeType, inp ...[][]SomeType) (done <-chan struct{})

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

func JoinSomeTypeSlice

func JoinSomeTypeSlice(out chan<- SomeType, inp ...[]SomeType) (done <-chan struct{})

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

func MakePointerChan

func MakePointerChan() (out chan *SomeType)

MakePointerChan returns a new open channel (simply a 'chan *SomeType' that is).

Note: No 'Pointer-producer' is launched here yet! (as is in all the other functions).

This is useful to easily create corresponding variables such as

var myPointerPipelineStartsHere := MakePointerChan()
// ... lot's of code to design and build Your favourite "myPointerWorkflowPipeline"
// ...
// ... *before* You start pouring data into it, e.g. simply via:
for drop := range water {
	myPointerPipelineStartsHere <- drop
}
close(myPointerPipelineStartsHere)

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 PipePointerBuffer) the channel is unbuffered.

func MakePointerSChan

func MakePointerSChan() (out chan []*SomeType)

MakePointerSChan returns a new open channel (simply a 'chan []*SomeType' that is).

Note: No 'PointerS-producer' is launched here yet! (as is in all the other functions).

This is useful to easily create corresponding variables such as

var myPointerSPipelineStartsHere := MakePointerSChan()
// ... lot's of code to design and build Your favourite "myPointerSWorkflowPipeline"
// ...
// ... *before* You start pouring data into it, e.g. simply via:
for drop := range water {
	myPointerSPipelineStartsHere <- drop
}
close(myPointerSPipelineStartsHere)

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 PipePointerSBuffer) the channel is unbuffered.

func MakeSomeTypeChan

func MakeSomeTypeChan() (out chan SomeType)

MakeSomeTypeChan returns a new open channel (simply a 'chan SomeType' that is).

Note: No 'SomeType-producer' is launched here yet! (as is in all the other functions).

This is useful to easily create corresponding variables such as

var mySomeTypePipelineStartsHere := MakeSomeTypeChan()
// ... lot's of code to design and build Your favourite "mySomeTypeWorkflowPipeline"
// ...
// ... *before* You start pouring data into it, e.g. simply via:
for drop := range water {
	mySomeTypePipelineStartsHere <- drop
}
close(mySomeTypePipelineStartsHere)

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 PipeSomeTypeBuffer) the channel is unbuffered.

func MakeSomeTypeSChan

func MakeSomeTypeSChan() (out chan []SomeType)

MakeSomeTypeSChan returns a new open channel (simply a 'chan []SomeType' that is).

Note: No 'SomeTypeS-producer' is launched here yet! (as is in all the other functions).

This is useful to easily create corresponding variables such as

var mySomeTypeSPipelineStartsHere := MakeSomeTypeSChan()
// ... lot's of code to design and build Your favourite "mySomeTypeSWorkflowPipeline"
// ...
// ... *before* You start pouring data into it, e.g. simply via:
for drop := range water {
	mySomeTypeSPipelineStartsHere <- drop
}
close(mySomeTypeSPipelineStartsHere)

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 PipeSomeTypeSBuffer) the channel is unbuffered.

func PipePointerBuffer

func PipePointerBuffer(inp <-chan *SomeType, cap int) (out <-chan *SomeType)

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

func PipePointerFork

func PipePointerFork(inp <-chan *SomeType) (out1, out2 <-chan *SomeType)

PipePointerFork 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 PipePointerFunc

func PipePointerFunc(inp <-chan *SomeType, act func(a *SomeType) *SomeType) (out <-chan *SomeType)

PipePointerFunc returns a channel to receive every result of act applied to inp before close. Note: it 'could' be PipePointerMap for functional people, but 'map' has a very different meaning in go lang.

func PipePointerSBuffer

func PipePointerSBuffer(inp <-chan []*SomeType, cap int) (out <-chan []*SomeType)

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

func PipePointerSFork

func PipePointerSFork(inp <-chan []*SomeType) (out1, out2 <-chan []*SomeType)

PipePointerSFork 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 PipePointerSFunc

func PipePointerSFunc(inp <-chan []*SomeType, act func(a []*SomeType) []*SomeType) (out <-chan []*SomeType)

PipePointerSFunc returns a channel to receive every result of act applied to inp before close. Note: it 'could' be PipePointerSMap for functional people, but 'map' has a very different meaning in go lang.

func PipeSomeTypeBuffer

func PipeSomeTypeBuffer(inp <-chan SomeType, cap int) (out <-chan SomeType)

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

func PipeSomeTypeFork

func PipeSomeTypeFork(inp <-chan SomeType) (out1, out2 <-chan SomeType)

PipeSomeTypeFork 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 PipeSomeTypeFunc

func PipeSomeTypeFunc(inp <-chan SomeType, act func(a SomeType) SomeType) (out <-chan SomeType)

PipeSomeTypeFunc returns a channel to receive every result of act applied to inp before close. Note: it 'could' be PipeSomeTypeMap for functional people, but 'map' has a very different meaning in go lang.

func PipeSomeTypeSBuffer

func PipeSomeTypeSBuffer(inp <-chan []SomeType, cap int) (out <-chan []SomeType)

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

func PipeSomeTypeSFork

func PipeSomeTypeSFork(inp <-chan []SomeType) (out1, out2 <-chan []SomeType)

PipeSomeTypeSFork 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 PipeSomeTypeSFunc

func PipeSomeTypeSFunc(inp <-chan []SomeType, act func(a []SomeType) []SomeType) (out <-chan []SomeType)

PipeSomeTypeSFunc returns a channel to receive every result of act applied to inp before close. Note: it 'could' be PipeSomeTypeSMap for functional people, but 'map' has a very different meaning in go lang.

func PointerDaisy

func PointerDaisy(inp <-chan *SomeType, tube PointerTube) (out <-chan *SomeType)

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

func PointerDaisyChain

func PointerDaisyChain(inp <-chan *SomeType, tubes ...PointerTube) (out <-chan *SomeType)

PointerDaisyChain returns a channel to receive all inp after having passed thru all tubes.

func PointerSDaisy

func PointerSDaisy(inp <-chan []*SomeType, tube PointerSTube) (out <-chan []*SomeType)

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

func PointerSDaisyChain

func PointerSDaisyChain(inp <-chan []*SomeType, tubes ...PointerSTube) (out <-chan []*SomeType)

PointerSDaisyChain returns a channel to receive all inp after having passed thru all tubes.

func SendProxyPointer

func SendProxyPointer(out chan<- *SomeType) chan<- *SomeType

SendProxyPointer 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 SendProxyPointerS

func SendProxyPointerS(out chan<- []*SomeType) chan<- []*SomeType

SendProxyPointerS 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 SendProxySomeType

func SendProxySomeType(out chan<- SomeType) chan<- SomeType

SendProxySomeType 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 SendProxySomeTypeS

func SendProxySomeTypeS(out chan<- []SomeType) chan<- []SomeType

SendProxySomeTypeS 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 SomeTypeDaisy

func SomeTypeDaisy(inp <-chan SomeType, tube SomeTypeTube) (out <-chan SomeType)

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

func SomeTypeDaisyChain

func SomeTypeDaisyChain(inp <-chan SomeType, tubes ...SomeTypeTube) (out <-chan SomeType)

SomeTypeDaisyChain returns a channel to receive all inp after having passed thru all tubes.

func SomeTypeSDaisy

func SomeTypeSDaisy(inp <-chan []SomeType, tube SomeTypeSTube) (out <-chan []SomeType)

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

func SomeTypeSDaisyChain

func SomeTypeSDaisyChain(inp <-chan []SomeType, tubes ...SomeTypeSTube) (out <-chan []SomeType)

SomeTypeSDaisyChain returns a channel to receive all inp after having passed thru all tubes.

Types

type PointerSTube

type PointerSTube func(inp <-chan []*SomeType, out <-chan []*SomeType)

PointerSTube is the signature for a pipe function.

type PointerTube

type PointerTube func(inp <-chan *SomeType, out <-chan *SomeType)

PointerTube is the signature for a pipe function.

type SomeType

type SomeType string

SomeType is some type and just represents a string.

type SomeTypeSTube

type SomeTypeSTube func(inp <-chan []SomeType, out <-chan []SomeType)

SomeTypeSTube is the signature for a pipe function.

type SomeTypeTube

type SomeTypeTube func(inp <-chan SomeType, out <-chan SomeType)

SomeTypeTube 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