Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrCouldNotMarshalEvent ¶
ErrCouldNotMarshalEvent is when an event could not be marshaled into BSON.
func ErrCouldNotPublishEvent ¶
ErrCouldNotPublishEvent is when kafka-client cannot send event to kafka
func ErrCouldNotUnmarshalEvent ¶
ErrCouldNotUnmarshalEvent is when an event could not be unmarshaled into BSON.
Types ¶
type EventBus ¶
type EventBus struct {
// contains filtered or unexported fields
}
EventBus is an event bus that notifies registered EventHandlers of published events. It will use the SimpleEventHandlingStrategy by default.
func NewEventBus ¶
func NewEventBus(brokers []string, config *sarama.Config, timeout time.Duration, topicProducer TopicProducer, topicsConsumer TopicsConsumer) (*EventBus, error)
NewEventBus creates a EventBus.
func NewEventBusWithMarshaller ¶
func NewEventBusWithMarshaller(brokers []string, config *sarama.Config, timeout time.Duration, topicProducer TopicProducer, topicsConsumer TopicsConsumer, eventMarshaller EventMarshaller, eventUnmarshaller EventUnmarshaller) (*EventBus, error)
NewEventBusWithMarshaller creates a EventBus.
func (*EventBus) AddHandler ¶
func (b *EventBus) AddHandler(m eh.EventMatcher, h eh.EventHandler)
AddHandler implements the AddHandler method of the eventhorizon.EventBus interface.
func (*EventBus) AddObserver ¶
func (b *EventBus) AddObserver(m eh.EventMatcher, h eh.EventHandler)
AddObserver implements the AddObserver method of the eventhorizon.EventBus interface.
func (*EventBus) Errors ¶
func (b *EventBus) Errors() <-chan eh.EventBusError
Errors returns an error channel where async handling errors are sent.
type EventMarshaller ¶
EventMarshaller eventbus event into specific marshaling format
type EventUnmarshaller ¶
EventUnmarshaller eventbus event from specific marshaling format
type TopicProducer ¶
TopicProducer for define name of topic regarding event type
type TopicsConsumer ¶
type TopicsConsumer func(event eh.EventHandler) []string
TopicsConsumer for define topic for consumption