tag

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: 2 Imported by: 0

Documentation

Index

Constants

View Source
const TagCAP = 10

TagCAP is the capacity of the buffered proxy channel

View Source
const TagQUE = 16

TagQUE is the allocated size of the circular queue

Variables

This section is empty.

Functions

func ChanTag

func ChanTag(inp ...*tag.TagAny) chan *tag.TagAny

ChanTag returns a channel to receive all inputs before close.

func ChanTagFuncErr

func ChanTagFuncErr(act func() (*tag.TagAny, error)) <-chan *tag.TagAny

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

func ChanTagFuncNil

func ChanTagFuncNil(act func() *tag.TagAny) <-chan *tag.TagAny

ChanTagFuncNil returns a channel to receive all results of act until nil before close.

func ChanTagFuncNok

func ChanTagFuncNok(act func() (*tag.TagAny, bool)) <-chan *tag.TagAny

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

func ChanTagSlice

func ChanTagSlice(inp ...[]*tag.TagAny) chan *tag.TagAny

ChanTagSlice returns a channel to receive all inputs before close.

func DoneTag

func DoneTag(inp <-chan *tag.TagAny) chan struct{}

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

func DoneTagFunc

func DoneTagFunc(inp <-chan *tag.TagAny, act func(a *tag.TagAny)) chan struct{}

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

func DoneTagSlice

func DoneTagSlice(inp <-chan *tag.TagAny) chan []*tag.TagAny

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

func JoinTag

func JoinTag(out chan<- *tag.TagAny, inp ...*tag.TagAny) chan struct{}

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

func JoinTagChan

func JoinTagChan(out chan<- *tag.TagAny, inp <-chan *tag.TagAny) chan struct{}

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

func JoinTagSlice

func JoinTagSlice(out chan<- *tag.TagAny, inp ...[]*tag.TagAny) chan struct{}

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

func MakeTagChan

func MakeTagChan() chan *tag.TagAny

MakeTagChan returns a new open channel (simply a 'chan *tag.TagAny' that is).

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

This is useful to easily create corresponding variables such as

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

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

func PipeTagBuffer

func PipeTagBuffer(inp <-chan *tag.TagAny, cap int) chan *tag.TagAny

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

func PipeTagFork

func PipeTagFork(inp <-chan *tag.TagAny) (chan *tag.TagAny, chan *tag.TagAny)

PipeTagFork 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 PipeTagFunc

func PipeTagFunc(inp <-chan *tag.TagAny, act func(a *tag.TagAny) *tag.TagAny) chan *tag.TagAny

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

func SendProxyTag

func SendProxyTag(out chan<- *tag.TagAny) chan<- *tag.TagAny

SendProxyTag 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 TagDaisy

func TagDaisy(inp <-chan *tag.TagAny, tube TagTube) (out <-chan *tag.TagAny)

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

func TagDaisyChain

func TagDaisyChain(inp <-chan *tag.TagAny, tubes ...TagTube) (out <-chan *tag.TagAny)

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

Types

type TagTube

type TagTube func(inp <-chan *tag.TagAny, out <-chan *tag.TagAny)

TagTube 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