httputils

package
v0.5.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 12, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

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 unmarshalled into the command.

func EventBusHandler

func EventBusHandler(eventBus eh.EventBus, m eh.EventMatcher, id string) http.Handler

EventBusHandler is a Websocket handler for eventhorizon.Events. Events will be forwarded to all requests that have been upgraded to websockets. TODO: Send events as JSON.

func QueryHandler

func QueryHandler(repo eh.ReadRepo) http.Handler

QueryHandler returns one or all items from a eventhorizon.ReadRepo. If the URL ends with a / it will return all items, otherwise it will try to use the last part of the path as an ID to return one item.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL