rest

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 13, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AlertReceiver

func AlertReceiver(alertCh chan MessageFault) http.Handler

AlertReceiver is an handler to manage http POST alert

func NewServer

func NewServer(routes []Route) http.Handler

NewServer configures a new router to the API

func StartServer

func StartServer(binAddr string, handler http.Handler)

StartServer is used to rest server initialization and start up

Types

type MessageFault

type MessageFault struct {
	Alert    template.Alert
	Response chan error
}

MessageFault contains - the fault received by the server, to be sent to the collector - a channel to get the error (if any) after posting the fault.

type Route

type Route struct {
	Name        string
	Method      string
	Pattern     string
	HandlerFunc http.Handler
}

Route defines a route

Jump to

Keyboard shortcuts

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