api

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2021 License: BSD-3-Clause Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApiAuth

func ApiAuth(config models.Config, db storage.Users) http.HandlerFunc

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 Status added in v0.3.2

func Status(counters storage.StatusTx) 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 UserRead

func UserRead(db storage.Users) http.HandlerFunc

func UserRemove

func UserRemove(db storage.Users) http.HandlerFunc

func UserUpdate added in v0.3.0

func UserUpdate(db storage.Users) http.HandlerFunc

func UsersAll

func UsersAll(db storage.Users) http.HandlerFunc

Types

This section is empty.

Jump to

Keyboard shortcuts

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