Documentation ¶
Index ¶
- Variables
- func RegisterTestNodeTypes()
- type AsyncFilterNode
- type ErrorHandlerNode
- type ErrorNode
- type FilterNode
- func (f *FilterNode) AckMessage(msg fbcontext.Message) error
- func (f *FilterNode) Process(event *firebolt.Event) (*firebolt.Event, error)
- func (f *FilterNode) Receive(msg fbcontext.Message) error
- func (f *FilterNode) SendMessage(msg fbcontext.Message) error
- func (f *FilterNode) Setup(config map[string]string) error
- func (f *FilterNode) Shutdown() error
- type IndexRequestBuilderNode
- type ResultsNode
- type SimpleSource
- type SlowNode
- type StringToProduceRequestNode
Constants ¶
This section is empty.
Variables ¶
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 ¶
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 ¶
Process handles the event and returns an optional result, and an optional error
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 ¶
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 ¶
Process handles the event and returns an optional result, and an optional error
func (*IndexRequestBuilderNode) Receive ¶
func (i *IndexRequestBuilderNode) Receive(msg fbcontext.Message) error
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 ¶
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) Shutdown ¶
func (s *SimpleSource) Shutdown() error
Shutdown stops the Source and cleans up any resources used
type SlowNode ¶
type SlowNode struct {
fbcontext.ContextAware
}
SlowNode is a Node that sleeps for 5s while processing each message
func (*SlowNode) Process ¶
Process handles the event and returns an optional result, and an optional error
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
func (s *StringToProduceRequestNode) Receive(msg fbcontext.Message) error
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