Documentation
¶
Index ¶
- func ApiAuth(config models.Config, db storage.Users) http.HandlerFunc
- func DeviceAdd(db storage.Devices) http.HandlerFunc
- func DeviceRead(db storage.Devices) http.HandlerFunc
- func DeviceRemove(db storage.Devices) http.HandlerFunc
- func DeviceUpdate(db storage.Devices) http.HandlerFunc
- func UpdateStatus(ch chan<- []net.HardwareAddr) http.HandlerFunc
- func UserCreate(db storage.Users) http.HandlerFunc
- func UserDevices(db storage.Devices) http.HandlerFunc
- func UserRead(db storage.Users) http.HandlerFunc
- func UserRemove(db storage.Users) http.HandlerFunc
- func UsersAll(db storage.Users) http.HandlerFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeviceAdd ¶
func DeviceAdd(db storage.Devices) http.HandlerFunc
DeviceAdd handles creation of new device for requesting user. Make sure to use with middleware.JWT (or another middleware that appends models.Claims to request), because this handler has to know some arbitrary user data.
func DeviceRead ¶
func DeviceRead(db storage.Devices) http.HandlerFunc
func DeviceRemove ¶
func DeviceRemove(db storage.Devices) http.HandlerFunc
func DeviceUpdate ¶
func DeviceUpdate(db storage.Devices) http.HandlerFunc
func UpdateStatus ¶
func UpdateStatus(ch chan<- []net.HardwareAddr) http.HandlerFunc
UpdateStatus updates online field of every user id database with MAC address equal to one from slice provided by user in request payload.
func UserCreate ¶
func UserCreate(db storage.Users) http.HandlerFunc
func UserDevices ¶
func UserDevices(db storage.Devices) http.HandlerFunc
UserDevices handler responses with list of devices owned by requesting user.
func UserRemove ¶
func UserRemove(db storage.Users) http.HandlerFunc
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.