www

package
v0.0.0-...-0896cb3 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2020 License: MIT Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckValidSession

func CheckValidSession(sessions *gohome.Sessions) func(rw http.ResponseWriter, r *http.Request, next http.HandlerFunc)

func DevicesToJSON

func DevicesToJSON(devs map[string]*gohome.Device) []jsonDevice

func ListenAndServe

func ListenAndServe(
	rootPath string,
	addr string,
	system *gohome.System,
	systemSavePath string,
	sessions *gohome.Sessions,
	cfg *gohome.Config) error

ListenAndServe creates a new WWW server, that handles API calls and also runs the gohome website

func RegisterAutomationHandlers

func RegisterAutomationHandlers(r *mux.Router, s *Server)

RegisterAutomationHandlers registers all of the automation specific API REST routes

func RegisterDeviceHandlers

func RegisterDeviceHandlers(r *mux.Router, s *Server)

RegisterDeviceHandlers registers the REST API routes relating to devices

func RegisterDiscoveryHandlers

func RegisterDiscoveryHandlers(r *mux.Router, s *Server)

RegisterDiscoveryHandlers registers all of the discovery specific API REST routes

func RegisterMonitorHandlers

func RegisterMonitorHandlers(r *mux.Router, s *Server)

RegisterMonitorHandlers registers all of the monitor specific REST API routes

func RegisterSceneHandlers

func RegisterSceneHandlers(r *mux.Router, s *Server)

RegisterSceneHandlers registers all of the scene specific API REST routes

func ScenesToJSON

func ScenesToJSON(inputScenes map[string]*gohome.Scene) scenes

Types

type Server

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

type WSHelper

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

func NewWSHelper

func NewWSHelper(monitor *gohome.Monitor, evtBus *evtbus.Bus) *WSHelper

func (*WSHelper) Expired

func (h *WSHelper) Expired(monitorID string)

func (*WSHelper) HTTPHandler

func (h *WSHelper) HTTPHandler() func(http.ResponseWriter, *http.Request)

func (*WSHelper) Update

func (h *WSHelper) Update(b *gohome.ChangeBatch)

Update is the callback to the monitor service, it will get change notifications when zones and sensors update

Jump to

Keyboard shortcuts

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