observation

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Marshal

func Marshal(extractedEvent ExtractedEvent) ([]byte, error)

Marshal converts the given observationExtractedEvent to a []byte.

Types

type CSVReader

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

CSVReader deserialises observations from an io.Reader containing CSV encoded observations.

func NewCSVReader

func NewCSVReader(ioreader io.Reader) *CSVReader

NewCSVReader returns a new CSVReader instance for the given io.CSVReader

func (*CSVReader) Read

func (reader *CSVReader) Read() (*Observation, error)

Read will take a line from the input batchReader and convert it into an Observation instance.

type ExtractedEvent

type ExtractedEvent struct {
	RowIndex   int64  `avro:"row_index"`
	Row        string `avro:"row"`
	InstanceID string `avro:"instance_id"`
}

ExtractedEvent is the data that is output for each observation extracted.

type MessageProducer

type MessageProducer interface {
	Channels() *kafka.ProducerChannels
}

MessageProducer dependency that writes messages

type MessageWriter

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

MessageWriter writes observations as messages

func NewMessageWriter

func NewMessageWriter(messageProducer MessageProducer) *MessageWriter

NewMessageWriter returns a new observation message writer.

func (MessageWriter) WriteAll

func (messageWriter MessageWriter) WriteAll(ctx context.Context, reader Reader, instanceID string)

WriteAll observations as messages from the given observation reader.

type Observation

type Observation struct {
	Row      string
	RowIndex int64
}

Observation represents a single observation value and its associated data.

type Reader

type Reader interface {
	Read() (*Observation, error)
}

Reader provides an common interface to read Observations

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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