Documentation ¶
Index ¶
- func DbConnect() (redis.Conn, error)
- func DbDel(key string) error
- func DbGet(key string) (values string, err error)
- func DbGetKeys(key string) (keys []string, err error)
- func DbHashGet(key string) (values []interface{}, err error)
- func DbHashSet(key string, data interface{}) error
- func DbSet(key string, value []byte) error
- func GetAllDevicesFromDb() (devices []string, err error)
- func HandleDetails(w http.ResponseWriter, r *http.Request)
- func HandleScheduleDel(w http.ResponseWriter, r *http.Request)
- func HandleScheduleGet(w http.ResponseWriter, r *http.Request)
- func HandleScheduleSet(w http.ResponseWriter, r *http.Request)
- func HandleScheduleUpdate(w http.ResponseWriter, r *http.Request)
- func HandleStatus(w http.ResponseWriter, r *http.Request)
- func LoadDevices() error
- func ReturnBad(w http.ResponseWriter, r *http.Request)
- func ReturnInternalError(w http.ResponseWriter, r *http.Request)
- func ReturnOk(w http.ResponseWriter, r *http.Request, resp http.Response)
- func ScheduleDel(device string) error
- func ScheduleSet(s *Schedules, device string) error
- func ScheduleUpdate(device string, status string) error
- func UpdateStatus(deviceName string, status bool) error
- type DeviceAction
- type Devices
- type Inputs
- type Schedule
- type Schedules
- type Status
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAllDevicesFromDb ¶
func HandleDetails ¶
func HandleDetails(w http.ResponseWriter, r *http.Request)
func HandleScheduleDel ¶
func HandleScheduleDel(w http.ResponseWriter, r *http.Request)
func HandleScheduleGet ¶
func HandleScheduleGet(w http.ResponseWriter, r *http.Request)
func HandleScheduleSet ¶
func HandleScheduleSet(w http.ResponseWriter, r *http.Request)
func HandleScheduleUpdate ¶
func HandleScheduleUpdate(w http.ResponseWriter, r *http.Request)
func HandleStatus ¶
func HandleStatus(w http.ResponseWriter, r *http.Request)
func LoadDevices ¶
func LoadDevices() error
func ReturnInternalError ¶
func ReturnInternalError(w http.ResponseWriter, r *http.Request)
func ReturnOk ¶
***************************************************************** Http Response helper functions
func ScheduleDel ¶
func ScheduleSet ¶
***************************************************************** Scheduler functions
func ScheduleUpdate ¶
func UpdateStatus ¶
Types ¶
type DeviceAction ¶
type DeviceAction struct {
Action bool `json:"action"`
}
type Devices ¶
type Devices struct { Device string `json:"device"` Type string `json:"type"` Name string `json:"name"` Addr string `json:"address"` NameFriendly string `json:"name_friendly"` NetPort string `json:"port"` Id string `json:"id"` Key string `json:"key"` Dps string `json:"dps"` }
func DetailsGet ¶
type Inputs ¶
func ReadDeviceFile ¶
Click to show internal directories.
Click to hide internal directories.