Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CommandHandler ¶
func CommandHandler(commandHandler eh.CommandHandler, commandType eh.CommandType) http.Handler
CommandHandler is a HTTP handler for eventhorizon.Commands. Commands must be registered with eventhorizon.RegisterCommand(). It expects a POST with a JSON body that will be unmarshaled into the command.
Types ¶
type EventBusHandler ¶
type EventBusHandler struct {
// contains filtered or unexported fields
}
EventBusHandler is a simple event handler for observing events.
func NewEventBusHandler ¶ added in v0.15.6
func NewEventBusHandler() *EventBusHandler
NewEventBusHandler creates a new EventBusHandler.
func (*EventBusHandler) HandleEvent ¶ added in v0.15.6
HandleEvent implements the HandleEvent method of the eventhorizon.EventHandler interface.
func (*EventBusHandler) HandlerType ¶ added in v0.15.6
func (h *EventBusHandler) HandlerType() eh.EventHandlerType
HandlerType implements the HandlerType method of the eventhorizon.EventHandler interface.
func (*EventBusHandler) ServeHTTP ¶ added in v0.15.6
func (h *EventBusHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP implements the ServeHTTP method of the http.Handler interface by upgrading requests to websocket connections which will receive all events.
Click to show internal directories.
Click to hide internal directories.