Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Event ¶
type Event interface { GetID() string GetCorrelationID() string GetType() string GetPayload() string LoadPayload() error SavePayload(event Event) error }
Event abstraction
type EventData ¶
type EventData struct { Event ID string `json:"id"` CorrelationID string `json:"corr_id"` Type string `json:"type"` Payload string `json:"payload"` }
EventData basic event structure which is use as base of all events
func (*EventData) GetCorrelationID ¶ added in v0.0.3
GetCorrelationID of event
func (*EventData) LoadPayload ¶
LoadPayload : fetch event type from payload
func (*EventData) SavePayload ¶
SavePayload save event structure to payload json string
type EventHandler ¶
type EventHandler interface {
Handle(event Event)
}
EventHandler an abstraction to processing specific event
type EventsHandlerManager ¶
type EventsHandlerManager struct {
// contains filtered or unexported fields
}
EventsHandlerManager keep all bindings event <-> eventHandler
func NewEventsHandlerManager ¶
func NewEventsHandlerManager() *EventsHandlerManager
NewEventsHandlerManager create new instance
func (*EventsHandlerManager) Execute ¶
func (h *EventsHandlerManager) Execute(event Event) error
Execute : find eventhandler and then execute an event
func (*EventsHandlerManager) Register ¶
func (h *EventsHandlerManager) Register(event Event, handler EventHandler) error
Register commandHandler event - should by instacne of Event handler - just EventHandler
type EventsMapper ¶
type EventsMapper struct {
// contains filtered or unexported fields
}
EventsMapper keep all registered events with their keys
func (*EventsMapper) Register ¶
func (m *EventsMapper) Register(event Event)
Register an event as pair string - event
Click to show internal directories.
Click to hide internal directories.