webui

package
v0.0.0-...-5fe7ae3 Latest Latest
Warning

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

Go to latest
Published: May 4, 2021 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const API_PREFIX string = "/api/v1"

Variables

View Source
var NocanClient *socket.EventConn
View Source
var SystemProperties *socket.SystemPropertiesEvent

Functions

func ErrorSend

func ErrorSend(w http.ResponseWriter, req *http.Request, e *helper.ExtendedError)

func JsonSend

func JsonSend(w http.ResponseWriter, req *http.Request, content interface{})

func JsonSendWithStatus

func JsonSendWithStatus(w http.ResponseWriter, req *http.Request, content interface{}, status int)

func Run

func Run(addr string, refresh_rate uint) error

Types

type GoHandler

type GoHandler struct {
	// contains filtered or unexported fields
}

func SimpleHandler

func SimpleHandler(h http.Handler) GoHandler

func (GoHandler) ServeHTTP

func (g GoHandler) ServeHTTP(w http.ResponseWriter, r *http.Request, params *Parameters)

type Handler

type Handler interface {
	ServeHTTP(http.ResponseWriter, *http.Request, *Parameters)
}

type HandlerDescriptor

type HandlerDescriptor struct {
	Pattern string
	Handler
}

type HandlerFunc

type HandlerFunc func(http.ResponseWriter, *http.Request, *Parameters)

func (HandlerFunc) ServeHTTP

func (f HandlerFunc) ServeHTTP(w http.ResponseWriter, r *http.Request, params *Parameters)
type Link struct {
	Href string
	Text string
}

type LogResponseWriter

type LogResponseWriter struct {
	Origin     http.ResponseWriter
	StatusCode int
	TotalBytes int
}

func NewLogResponseWriter

func NewLogResponseWriter(origin http.ResponseWriter) *LogResponseWriter

func (*LogResponseWriter) Header

func (l *LogResponseWriter) Header() http.Header

func (*LogResponseWriter) Write

func (l *LogResponseWriter) Write(b []byte) (int, error)

func (*LogResponseWriter) WriteHeader

func (l *LogResponseWriter) WriteHeader(statusCode int)

type Parameters

type Parameters struct {
	Value map[string]string
}

func NewParameters

func NewParameters() *Parameters

func (*Parameters) String

func (p *Parameters) String() string

type ServeMux

type ServeMux struct {
	Patterns []HandlerDescriptor
}

func NewServeMux

func NewServeMux() *ServeMux

func (*ServeMux) Handle

func (mux *ServeMux) Handle(pattern string, handler Handler)

func (*ServeMux) HandleFunc

func (mux *ServeMux) HandleFunc(pattern string, handler_func func(http.ResponseWriter, *http.Request, *Parameters))

func (*ServeMux) Handler

func (mux *ServeMux) Handler(r *http.Request) (h Handler, pattern string, params *Parameters)

func (*ServeMux) ServeHTTP

func (mux *ServeMux) ServeHTTP(w http.ResponseWriter, r *http.Request)

type TemplateCollectionHandler

type TemplateCollectionHandler struct {
	// contains filtered or unexported fields
}

func NewTemplateCollectionHandler

func NewTemplateCollectionHandler(box *packr.Box) (*TemplateCollectionHandler, error)

func (*TemplateCollectionHandler) Handle

func (handler *TemplateCollectionHandler) Handle(model string) *TemplateHandler

type TemplateHandler

type TemplateHandler struct {
	// contains filtered or unexported fields
}

func (*TemplateHandler) ServeHTTP

func (handler *TemplateHandler) ServeHTTP(w http.ResponseWriter, req *http.Request, params *Parameters)

Jump to

Keyboard shortcuts

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