text

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 1, 2020 License: MIT Imports: 5 Imported by: 0

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

func (*Reader) Process

func (t *Reader) Process(ctx context.Context, args selina.ProcessArgs) (err error)

Process implements Worker interface

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
}

ReaderOptions customize Reader

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

func (*Writer) Process

func (t *Writer) Process(ctx context.Context, args selina.ProcessArgs) (err error)

Process implements Worker interface

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
}

WriterOptions customize Writer

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL