externalapi

package
v0.0.0-...-a52e8f6 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHandler

func NewHandler(maxRequestSize int64, eventsClient subscribed.EventsClient) http.Handler

NewHandler creates http.Handler(s) for the /v1/events /v2/events /v1/subscribedevents and /v1/health endpoints

func NewHealthCheckHandler

func NewHealthCheckHandler() http.Handler

NewHealthCheckHandler creates handler for performing health check

Types

type ErrorHandler

type ErrorHandler struct {
	Message string
	Code    int
}

An ErrorHandler represents an error with a message and a status code

func NewErrorHandler

func NewErrorHandler(code int, message string) *ErrorHandler

NewErrorHandler creates a new ErrorHandler with the given code and message

func (*ErrorHandler) ServeHTTP

func (eh *ErrorHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type SubscribedEventsHandler

type SubscribedEventsHandler interface {
	GetSubscribedEvents(w http.ResponseWriter, r *http.Request)
}

SubscribedEventsHandler is an interface representing handler for the /v1/subscribedevents endpoint

func NewActiveEventsHandler

func NewActiveEventsHandler(eventsClient subscribed.EventsClient) SubscribedEventsHandler

NewActiveEventsHandler creates handler to handle subscribedevents endpoint

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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