Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CompositeEventHandler ¶
type CompositeEventHandler struct {
// contains filtered or unexported fields
}
CompositeEventHandler is a public struct that composes multiple event handlers.
func (*CompositeEventHandler) AddHandlers ¶
func (h *CompositeEventHandler) AddHandlers(handlers ...EventHandler) *CompositeEventHandler
AddHandlers adds child handlers to the composite event handler.
func (*CompositeEventHandler) Handle ¶
func (h *CompositeEventHandler) Handle(event cloudevents.Event) cloudevents.Result
Handle handles the given event.
func (*CompositeEventHandler) SupportEventTypes ¶
func (h *CompositeEventHandler) SupportEventTypes() []string
SupportEventTypes returns a list of supported event types.
type EventConsumer ¶
type EventConsumer struct {
// contains filtered or unexported fields
}
func NewEventConsumer ¶
func NewEventConsumer(cfg config.Kafka, topic string, hander EventHandler, faultWriter *kafka.Writer) (*EventConsumer, error)
func (*EventConsumer) Close ¶
func (ec *EventConsumer) Close()
type EventConsumerGroup ¶
type EventConsumerGroup map[string]*EventConsumer
func NewEventConsumerGroup ¶
func NewEventConsumerGroup(cfg config.Kafka, hander EventHandler) (EventConsumerGroup, error)
func (EventConsumerGroup) Close ¶
func (ecs EventConsumerGroup) Close()
type EventHandler ¶
type EventHandler interface { // Valid fn signatures are: // * func() // * func() protocol.Result // * func(context.Context) // * func(context.Context) protocol.Result // * func(event.Event) // * func(event.Event) transport.Result // * func(context.Context, event.Event) // * func(context.Context, event.Event) protocol.Result // * func(event.Event) *event.Event // * func(event.Event) (*event.Event, protocol.Result) // * func(context.Context, event.Event) *event.Event // * func(context.Context, event.Event) (*event.Event, protocol.Result) // Handle handles the given event. Handle(event cloudevents.Event) cloudevents.Result // SupportEventTypes returns a list of supported event types. SupportEventTypes() []string }
EventHandler is an interface that defines the Handle method.
type EventProducer ¶
type EventProducer struct {
// contains filtered or unexported fields
}
EventProducer is the main structure for our event broker
func NewEventProducer ¶
func NewEventProducer(cfg config.Kafka) (*EventProducer, error)
func (*EventProducer) HandleCloudEvent ¶
func (eb *EventProducer) HandleCloudEvent(ctx context.Context, event cloudevents.Event) cloudevents.Result
Click to show internal directories.
Click to hide internal directories.