Documentation ¶
Index ¶
- func CheckValidSession(sessions *gohome.Sessions) func(rw http.ResponseWriter, r *http.Request, next http.HandlerFunc)
- func DevicesToJSON(devs map[string]*gohome.Device) []jsonDevice
- func ListenAndServe(rootPath string, addr string, system *gohome.System, systemSavePath string, ...) error
- func RegisterAutomationHandlers(r *mux.Router, s *Server)
- func RegisterDeviceHandlers(r *mux.Router, s *Server)
- func RegisterDiscoveryHandlers(r *mux.Router, s *Server)
- func RegisterMonitorHandlers(r *mux.Router, s *Server)
- func RegisterSceneHandlers(r *mux.Router, s *Server)
- func ScenesToJSON(inputScenes map[string]*gohome.Scene) scenes
- type Server
- type WSHelper
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 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 ¶
RegisterAutomationHandlers registers all of the automation specific API REST routes
func RegisterDeviceHandlers ¶
RegisterDeviceHandlers registers the REST API routes relating to devices
func RegisterDiscoveryHandlers ¶
RegisterDiscoveryHandlers registers all of the discovery specific API REST routes
func RegisterMonitorHandlers ¶
RegisterMonitorHandlers registers all of the monitor specific REST API routes
func RegisterSceneHandlers ¶
RegisterSceneHandlers registers all of the scene specific API REST routes
func ScenesToJSON ¶
Types ¶
type WSHelper ¶
type WSHelper struct {
// contains filtered or unexported fields
}
func NewWSHelper ¶
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
Click to show internal directories.
Click to hide internal directories.