reader

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cfg

type Cfg struct {
	Log    logger.Logger `validate:"nonnil"`
	Reader io.Reader     `validate:"nonnil"`

	Bus      eventutil.Bus     `validate:"nonnil"`
	DataRead model.EventAction `validate:"nonzero"`
}

Cfg defines config for Reader.

type Reader

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

Reader reads the data line-by-line basis from provided io.Reader, and publishes this data to provided topic on bus. Use #NewReader to create new instance.

func NewReader

func NewReader(cfg *Cfg) (*Reader, error)

NewReader validates Reader-Config and creates new Reader-instance.

func (*Reader) Start

func (r *Reader) Start(ctx context.Context) error

Start runs the loop which reads lines from provided io.Reader and listens for context-signal.

Jump to

Keyboard shortcuts

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