controllers

package
Version: v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2020 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BindREST

func BindREST(m *mux.Router, rests map[string]*REST) error

BindREST makes a lookup in the database to configure the REST endpoint and binds the handler to the given route

func BindRoutes

func BindRoutes(m *mux.Router) error

BindRoutes binds all the API endpoints to the exposed router.

func LogUserAction

func LogUserAction(req *http.Request, text string) error

func SendEmptyJSON

func SendEmptyJSON(rw http.ResponseWriter, code int)

SendEmptyJSON sends an empty JSON document to the client.

func SendFailure

func SendFailure(rw http.ResponseWriter, format string, args ...interface{})

SendFailure sends a failure message to the client.

func SendJSON

func SendJSON(rw http.ResponseWriter, code int, data interface{})

SendJSON sends JSON encoded data to client.

func StartAlarmStream

func StartAlarmStream() error

StartAlarmStream starts the server side streaming service for alarms

func StartStrokeStream

func StartStrokeStream() error

StartStrokeStream starts the server side streaming service for strokes

Types

type REST

type REST struct {
	GET     http.Handler
	PUT     http.Handler
	POST    http.Handler
	DELETE  http.Handler
	Queries map[string]string
}

REST represents the mapping between the http method and a handler.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL