Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNilReader = errors.New("nil io.Reader provided to TextReader")
)
ErrNilReader is returned when a nil io.Reader interface is provided
View Source
var ErrNilWriter = errors.New("nil io.Writer provided to TextWriter")
ErrNilWriter returned when a nil io.Writer is provided
Functions ¶
This section is empty.
Types ¶
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
Reader a worker that read data from an io.Reader
func NewReader ¶
func NewReader(opts ReaderOptions) *Reader
NewReader create a new Reader with given options
type ReaderOptions ¶
type ReaderOptions struct { // Reader from which data is readed Reader io.Reader // AutoClose if its true and Reader implements io.Closer // io.Reader.Close() method is called on Process finish AutoClose bool // Default is ScanLines SplitFunc bufio.SplitFunc // ReadFormat process every data point with this function // default is nil , raw message is passed to WriteFormat ReadFormat selina.Unmarshaler // WriteFormat by default is json.Marshal WriteFormat selina.Marshaler }
ReaderOptions customize Reader
func (ReaderOptions) Check ¶ added in v0.8.0
func (o ReaderOptions) Check() error
Check if a combination of options is valid
type Writer ¶
type Writer struct {
// contains filtered or unexported fields
}
Writer a Worker that write data to a given io.Writer in text format
func NewWriter ¶
func NewWriter(opts WriterOptions) *Writer
NewWriter create a new Writer with given options
type WriterOptions ¶
type WriterOptions struct { // Writer io.Writer where data will be written Writer io.Writer // AutoClose when true and Writer implements io.Closer // io.Closer.Close() method will be called on finalization AutoClose bool SkipNewLine bool BufferSize int Codec selina.Marshaler }
WriterOptions customize Writer
func (WriterOptions) Check ¶ added in v0.8.0
func (o WriterOptions) Check() error
Check if a combination of options is valid
Click to show internal directories.
Click to hide internal directories.