internal

package
v0.1.12 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// SuccessEvents collects events that successfully reach ResultsNode
	SuccessEvents = make(chan string, 100000)

	// FilteredEvents collects events that are filtered out by FilterNode
	FilteredEvents = make(chan string, 100000)

	// ErrorEvents collects events that return errors in ErrorNode
	ErrorEvents = make(chan string, 100000)

	// ErrorHandlerEvents collects events that return errors in ErrorHandlerNode
	ErrorHandlerEvents = make(chan interface{}, 100000)

	// FilterNodeMessages collects messages received by FilterNode
	FilterNodeMessages = make(chan fbcontext.Message, 100000)

	// ResultsNodeMessages collects messages received by ResultsNode
	ResultsNodeMessages = make(chan fbcontext.Message, 100000)

	// AsyncPassedEvents collects messages passed through by AsyncFilterNode
	AsyncPassedEvents = make(chan string, 100000)

	// AsyncFilteredEvents collects messages filtered out by AsyncFilterNode
	AsyncFilteredEvents = make(chan string, 100000)
)

Functions

func RegisterTestNodeTypes

func RegisterTestNodeTypes()

RegisterTestNodeTypes registers every source and node type in this file so that they're ready to be used in tests

Types

type AsyncFilterNode

type AsyncFilterNode struct {
	fbcontext.ContextAware
}

AsyncFilterNode is a AsyncNode version of FilterNode that sleeps for 1s while processing each message

func (*AsyncFilterNode) ProcessAsync

func (a *AsyncFilterNode) ProcessAsync(event *firebolt.AsyncEvent)

ProcessAsync handles the event and returns an optional result, and an optional error

func (*AsyncFilterNode) Receive

func (a *AsyncFilterNode) Receive(msg fbcontext.Message) error

Receive handles a message from another node or an external source

func (*AsyncFilterNode) Setup

func (a *AsyncFilterNode) Setup(config map[string]string) error

Setup is a no-op in asyncfilternode

func (*AsyncFilterNode) Shutdown

func (a *AsyncFilterNode) Shutdown() error

Shutdown provides an opportunity for the Node to clean up resources on shutdown

type ErrorHandlerNode

type ErrorHandlerNode struct {
	fbcontext.ContextAware
}

ErrorHandlerNode is a Node used as `error_handler` that simply puts the events it gets on a channel

func (*ErrorHandlerNode) Process

func (ehn *ErrorHandlerNode) Process(event *firebolt.Event) (*firebolt.Event, error)

Process handles the event and returns an optional result, and an optional error

func (*ErrorHandlerNode) Receive

func (ehn *ErrorHandlerNode) Receive(msg fbcontext.Message) error

Receive handles a message from another node or an external source

func (*ErrorHandlerNode) Setup

func (ehn *ErrorHandlerNode) Setup(config map[string]string) error

Setup is a no-op in errorhandlernode

func (*ErrorHandlerNode) Shutdown

func (ehn *ErrorHandlerNode) Shutdown() error

Shutdown provides an opportunity for the Node to clean up resources on shutdown

type ErrorNode

type ErrorNode struct {
	fbcontext.ContextAware
}

ErrorNode is a Node that returns an error for any events starting with 'error'

func (*ErrorNode) Process

func (e *ErrorNode) Process(event *firebolt.Event) (*firebolt.Event, error)

Process handles the event and returns an optional result, and an optional error

func (*ErrorNode) Receive

func (e *ErrorNode) Receive(msg fbcontext.Message) error

Receive handles a message from another node or an external source

func (*ErrorNode) Setup

func (e *ErrorNode) Setup(config map[string]string) error

Setup is a no-op in errornode

func (*ErrorNode) Shutdown

func (e *ErrorNode) Shutdown() error

Shutdown provides an opportunity for the Node to clean up resources on shutdown

type FilterNode

type FilterNode struct {
	fbcontext.ContextAware
}

FilterNode is a Node that filters out any events starting with 'filter'

func (*FilterNode) AckMessage

func (f *FilterNode) AckMessage(msg fbcontext.Message) error

AckMessage lets unit/integration tests acknowledge receipt of a message.

func (*FilterNode) Process

func (f *FilterNode) Process(event *firebolt.Event) (*firebolt.Event, error)

Process handles the event and returns an optional result, and an optional error

func (*FilterNode) Receive

func (f *FilterNode) Receive(msg fbcontext.Message) error

Receive handles a message from another node or an external source

func (*FilterNode) SendMessage

func (f *FilterNode) SendMessage(msg fbcontext.Message) error

SendMessage lets unit/integration tests send a message through the fbcontext.

func (*FilterNode) Setup

func (f *FilterNode) Setup(config map[string]string) error

Setup initializes the node so that it's ready for processing

func (*FilterNode) Shutdown

func (f *FilterNode) Shutdown() error

Shutdown provides an opportunity for the Node to clean up resources on shutdown

type IndexRequestBuilderNode

type IndexRequestBuilderNode struct {
	fbcontext.ContextAware
	// contains filtered or unexported fields
}

IndexRequestBuilderNode is a Node that converts strings to elasticsearch IndexRequests

func (*IndexRequestBuilderNode) Process

func (i *IndexRequestBuilderNode) Process(event *firebolt.Event) (*firebolt.Event, error)

Process handles the event and returns an optional result, and an optional error

func (*IndexRequestBuilderNode) Receive

Receive handles a message from another node or an external source

func (*IndexRequestBuilderNode) Setup

func (i *IndexRequestBuilderNode) Setup(config map[string]string) error

Setup is a no-op

func (*IndexRequestBuilderNode) Shutdown

func (i *IndexRequestBuilderNode) Shutdown() error

Shutdown provides an opportunity for the Node to clean up resources on shutdown

type ResultsNode

type ResultsNode struct {
	fbcontext.ContextAware
}

ResultsNode is a Node that writes all result data to an array for inspection & assertions

func (*ResultsNode) Process

func (r *ResultsNode) Process(event *firebolt.Event) (*firebolt.Event, error)

Process handles the event and returns an optional result, and an optional error

func (*ResultsNode) Receive

func (r *ResultsNode) Receive(msg fbcontext.Message) error

Receive handles a message from another node or an external source

func (*ResultsNode) Setup

func (r *ResultsNode) Setup(config map[string]string) error

Setup is a no-op in resultsnode

func (*ResultsNode) Shutdown

func (r *ResultsNode) Shutdown() error

Shutdown provides an opportunity for the Node to clean up resources on shutdown

type SimpleSource

type SimpleSource struct {
	fbcontext.ContextAware
	// contains filtered or unexported fields
}

SimpleSource is a source for testing that produces test records and exits

func (*SimpleSource) Receive

func (s *SimpleSource) Receive(msg fbcontext.Message) error

Receive handles a message from another node or an external source

func (*SimpleSource) Setup

func (s *SimpleSource) Setup(config map[string]string, recordschan chan firebolt.Event) error

Setup instantiates and configures the Source

func (*SimpleSource) Shutdown

func (s *SimpleSource) Shutdown() error

Shutdown stops the Source and cleans up any resources used

func (*SimpleSource) Start

func (s *SimpleSource) Start() error

Start runs the Source

type SlowNode

type SlowNode struct {
	fbcontext.ContextAware
}

SlowNode is a Node that sleeps for 5s while processing each message

func (*SlowNode) Process

func (r *SlowNode) Process(event *firebolt.Event) (*firebolt.Event, error)

Process handles the event and returns an optional result, and an optional error

func (*SlowNode) Receive

func (r *SlowNode) Receive(msg fbcontext.Message) error

Receive handles a message from another node or an external source

func (*SlowNode) Setup

func (r *SlowNode) Setup(config map[string]string) error

Setup is a no-op in slownode

func (*SlowNode) Shutdown

func (r *SlowNode) Shutdown() error

Shutdown provides an opportunity for the Node to clean up resources on shutdown

type StringToProduceRequestNode added in v0.1.2

type StringToProduceRequestNode struct {
	fbcontext.ContextAware
}

StringToProduceRequestNode is a Node that converts strings to `firebolt.ProduceRequest`

func (*StringToProduceRequestNode) Process added in v0.1.2

Process handles the event and returns an optional result, and an optional error

func (*StringToProduceRequestNode) Receive added in v0.1.2

Receive handles a message from another node or an external source

func (*StringToProduceRequestNode) Setup added in v0.1.2

func (s *StringToProduceRequestNode) Setup(config map[string]string) error

Setup is a no-op in StringToProduceRequestNode

func (*StringToProduceRequestNode) Shutdown added in v0.1.2

func (s *StringToProduceRequestNode) Shutdown() error

Shutdown provides an opportunity for the Node to clean up resources on shutdown

Jump to

Keyboard shortcuts

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