Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChanEmitter ¶
type ChanEmitter struct {
// contains filtered or unexported fields
}
ChanEmitter is an emitter that takes in a channel and and sets it up as the source of the emitter .
func (*ChanEmitter) GetOutput ¶
func (c *ChanEmitter) GetOutput() <-chan interface{}
GetOutput returns the output channel of this source node
type CsvEmitter ¶
type CsvEmitter struct {
// contains filtered or unexported fields
}
CsvEmitter implements an Emitter node that gets its content from the specified io.Reader and emits each record as []string.
func CSV ¶
func CSV(source interface{}) *CsvEmitter
CSV creates a new CsvEmitter. If the source parameter is a string, it attempts to open a file with that name. If source is an io.Reader, it sources from the reader directly. Any other source type will cause an error.
func (*CsvEmitter) CommentChar ¶
func (c *CsvEmitter) CommentChar(char rune) *CsvEmitter
CommentChar sets the character used to indicate comment lines
func (*CsvEmitter) DelimChar ¶
func (c *CsvEmitter) DelimChar(char rune) *CsvEmitter
Delimiter sets the delimiter character to use (default is comma)
func (*CsvEmitter) GetOutput ¶
func (c *CsvEmitter) GetOutput() <-chan interface{}
GetOutput returns the channel for the source
func (*CsvEmitter) HasHeaders ¶
func (c *CsvEmitter) HasHeaders() *CsvEmitter
HasHeaders indicates that data source has header record
type ReaderEmitter ¶
type ReaderEmitter struct {
// contains filtered or unexported fields
}
ReaderEmitter takes an io.Reader as its source and emits a slice of bytes, N length, with each iteration.
func Reader ¶
func Reader(reader io.Reader) *ReaderEmitter
Reader returns a *ReaderEmitter which can be used to emit bytes
func (*ReaderEmitter) BufferSize ¶
func (e *ReaderEmitter) BufferSize(s int) *ReaderEmitter
BufferSize sets the size of the transfer buffer used to read from the source io.Reader.
func (*ReaderEmitter) GetOutput ¶
func (e *ReaderEmitter) GetOutput() <-chan interface{}
GetOutput returns the output channel of this source node
type ScannerEmitter ¶
type ScannerEmitter struct {
// contains filtered or unexported fields
}
ScannerEmitter takes an io.Reader as its source and emits and wraps it into a bufio.Scanner. The scanner tokenizes the source data using the splitter func of type bufio.SplitFunc and emits each token as []byte.
func Scanner ¶
func Scanner(reader io.Reader, splitter bufio.SplitFunc) *ScannerEmitter
Scanner returns a *ScannerEmitter that wraps io.Reader into a bufio.Scanner. The SplitFunc is used to tokenize the IO stream. The text value of the token is sent downstream. bufio.ScanLines will be used by default if none is provided.
func (*ScannerEmitter) GetOutput ¶
func (e *ScannerEmitter) GetOutput() <-chan interface{}
GetOutput returns the output channel of this source node
type SliceEmitter ¶
type SliceEmitter struct {
// contains filtered or unexported fields
}
SliceEmitter is an emitter that takes in a slice and emits slice items individually as a stream.
func (*SliceEmitter) GetOutput ¶
func (s *SliceEmitter) GetOutput() <-chan interface{}
GetOuptut returns the output channel of this source node