collectors

package
Version: v0.1.0-alpha.0 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CollectorFunc

type CollectorFunc func(interface{}) error

CollectorFunc is a function used to colllect incoming stream data. It can be used as a stream sink.

type CsvCollector

type CsvCollector struct {
	// contains filtered or unexported fields
}

CsvCollector represents a node that can collect items streamed as type []string and write them as comma-separated values to the specified io.Writer or file.

func CSV

func CSV(sink interface{}) *CsvCollector

CSV creates a *CsvCollector value

func (*CsvCollector) DelimChar

func (c *CsvCollector) DelimChar(char rune) *CsvCollector

func (*CsvCollector) Headers

func (c *CsvCollector) Headers(headers []string) *CsvCollector

func (*CsvCollector) Open

func (c *CsvCollector) Open(ctx context.Context) <-chan error

Open is the starting point that opens the sink for data to start flowing

func (*CsvCollector) SetInput

func (c *CsvCollector) SetInput(in <-chan interface{})

SetInput sets the channel input

type FuncCollector

type FuncCollector struct {
	// contains filtered or unexported fields
}

FuncCollector is a colletor that uses a function to collect data. The specified function must be of type:

CollectorFunc

func Func

Func creates a new value *FuncCollector that will use the specified function parameter to collect streaming data.

func (*FuncCollector) Open

func (c *FuncCollector) Open(ctx context.Context) <-chan error

Open is the starting point that starts the collector

func (*FuncCollector) SetInput

func (c *FuncCollector) SetInput(in <-chan interface{})

SetInput sets the channel input

type NullCollector

type NullCollector struct {
	// contains filtered or unexported fields
}

func Null

func Null() *NullCollector

func (*NullCollector) Open

func (s *NullCollector) Open(ctx context.Context) <-chan error

Open opens the node to start collecting

func (*NullCollector) SetInput

func (s *NullCollector) SetInput(in <-chan interface{})

type SliceCollector

type SliceCollector struct {
	// contains filtered or unexported fields
}

func Slice

func Slice() *SliceCollector

func (*SliceCollector) Get

func (s *SliceCollector) Get() []interface{}

func (*SliceCollector) Open

func (s *SliceCollector) Open(ctx context.Context) <-chan error

func (*SliceCollector) SetInput

func (s *SliceCollector) SetInput(in <-chan interface{})

type WriterCollector

type WriterCollector struct {
	// contains filtered or unexported fields
}

func Writer

func Writer(writer io.Writer) *WriterCollector

func (*WriterCollector) Open

func (c *WriterCollector) Open(ctx context.Context) <-chan error

func (*WriterCollector) SetInput

func (c *WriterCollector) SetInput(in <-chan interface{})

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL