Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EventCache ¶
type EventConnection ¶
type EventConnection interface { NewInput(config.Input) (EventInput, error) NewOutput(config.Output) (EventOutput, error) NewCache(config.Cache) (EventCache, error) Close() error }
type EventInput ¶
type EventInput interface { Receive() (<-chan EventMessage, error) Close() error }
EventInput is a source of events that can be consumed by the EventRunner
EventInput is an interface for sources of events that can be consumed by the EventRunner. This interface is implemented by sources such as Kafka or Redis.
Receive is called by the EventRunner to receive events from the source. The implementation of this method should block until an event is available or an error occurs. When an event is available the implementation should call the `EventReceiver` function with the event. When an error occurs the implementation should return the error.
type EventMessage ¶
type EventMessage interface { Time() (time.Time, error) Topic() (string, error) ReplyTo() (string, error) Metadata(string) ([]string, error) Data() ([]byte, error) DataString() (string, error) Ack() error Nak() error }
EventMessage is an interface for messages that contain event data. The interface is implemented by event sources such as Kafka or Redis.
The methods on EventMessage should be called by the EventRunner when it receives an event. The methods provide access to the details of the event such as the source of the event, the headers, and the data
type EventOutput ¶
type EventOutput interface { Ingest(<-chan RunnerResult) error Close() error }
type EventPlugin ¶
type EventPlugins ¶
type EventPlugins interface {
GetPlugin(id string) (EventPlugin, error)
}
type PluginCommandResult ¶
type Runner ¶
type Runner interface { Ingest(<-chan EventMessage) (<-chan RunnerResult, error) Stop() error }
type RunnerManager ¶
type RunnerManager interface { New(EventCache, EventPlugins) (Runner, error) StopAll() error }
type RunnerResult ¶
type RunnerResult interface { // Setters SetData(any) AddMetadata(string, string) SetMetadata(string, string) SetConfig(string, string) // Getters HasResult() bool Message() EventMessage Destination() (string, error) Metadata() (map[string][]string, error) Config() (map[string]string, error) Data() (any, error) // Ack and Nak Ack() error Nak() error }