Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Action ¶
type Action interface { // Execute to invoke when a message is received. Return nil to not send a response or return an instance to send in response Execute(event datamodel.ModelReceiveEvent) (datamodel.ModelSendEvent, error) }
Action defines a specific action interface for running an action in response to an event
func NewAction ¶
func NewAction(callback ActionFunc) Action
NewAction is a convenient wrapper that implements the Action interface
type ActionFunc ¶
type ActionFunc func(instance datamodel.ModelReceiveEvent) (datamodel.ModelSendEvent, error)
type ActionSubscription ¶
type ActionSubscription struct {
// contains filtered or unexported fields
}
ActionSubscription is returned to control when the subscription should be closed
func Register ¶
Register an action and return a subscription. You must call Close on the response when you're done (or shutting down)
func (*ActionSubscription) Close ¶
func (s *ActionSubscription) Close() error
Close should be called to stop receiving data from event server
func (*ActionSubscription) WaitForReady ¶
func (s *ActionSubscription) WaitForReady()
WaitForReady will block until the subscription is ack
type Config ¶
type Config struct { // GroupID is the consumer group id GroupID string // Channel to use when subscribing Channel string // APIKey to use when subscribing APIKey string // Headers to use when subscribing Headers map[string]string // Topic to use when subscribing Topic string // Errors is a channel for writing any errors during processing Errors chan<- error // Factory is a model factory if you need to modify to use a different once Factory ModelFactory // Offset controls where to start reading from. if not provided, will be from the latest Offset string // set the logger to use Logger log.Logger }
type ModelFactory ¶
type ModelFactory interface {
New(name datamodel.ModelNameType) datamodel.Model
}
ModelFactory creates new instances of models
Click to show internal directories.
Click to hide internal directories.