Documentation
¶
Index ¶
- Constants
- Variables
- func ErrorSend(w http.ResponseWriter, req *http.Request, e *helper.ExtendedError)
- func JsonSend(w http.ResponseWriter, req *http.Request, content interface{})
- func JsonSendWithStatus(w http.ResponseWriter, req *http.Request, content interface{}, status int)
- func Run(addr string, refresh_rate uint) error
- type GoHandler
- type Handler
- type HandlerDescriptor
- type HandlerFunc
- type Link
- type LogResponseWriter
- type Parameters
- type ServeMux
- type TemplateCollectionHandler
- type TemplateHandler
Constants ¶
View Source
const API_PREFIX string = "/api/v1"
Variables ¶
View Source
var ChannelList *socket.ChannelListEvent
View Source
var (
DeviceInfo *socket.DeviceInformationEvent = nil
)
View Source
var NocanClient *socket.EventConn
View Source
var NodeList *socket.NodeListEvent
View Source
var PowerStatus *socket.BusPowerStatusUpdateEvent
View Source
var SystemProperties *socket.SystemPropertiesEvent
Functions ¶
func ErrorSend ¶
func ErrorSend(w http.ResponseWriter, req *http.Request, e *helper.ExtendedError)
func JsonSendWithStatus ¶
func JsonSendWithStatus(w http.ResponseWriter, req *http.Request, content interface{}, status int)
Types ¶
type GoHandler ¶
type GoHandler struct {
// contains filtered or unexported fields
}
func SimpleHandler ¶
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 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 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) WriteHeader ¶
func (l *LogResponseWriter) WriteHeader(statusCode int)
type Parameters ¶
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) HandleFunc ¶
func (mux *ServeMux) HandleFunc(pattern string, handler_func func(http.ResponseWriter, *http.Request, *Parameters))
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)
Click to show internal directories.
Click to hide internal directories.