handler

package
v0.0.0-...-ae882e2 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Count

func Count() int

Count provides the count of registed handlers

func Register

func Register(path string, handler Handler)

func Setup

func Setup(sendc chan<- line.Notification)

Setup initialize handlers and register http paths

func WriteJSON

func WriteJSON(w http.ResponseWriter, status int, message string) error

WriteJSON writes status and message into JSON response

Types

type Handler

type Handler interface {
	Init(sendc chan<- line.Notification)
	Authorize(r *http.Request) (bool, error)
	ServeHTTP(w http.ResponseWriter, r *http.Request)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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