package
0.0.0-20200610072636-3c57ce01c3a2
Repository: https://github.com/xiorcale/rubus-api.git
Documentation: pkg.go.dev

# Functions

AcquireDevice sets the `User` parameter as the owner of the `Device`.
AddDevice inserts a new `Device` into the database.
AddDeviceMulti insters multiple `Device` into the database.
AddUser inserts a new `User` into the database.
DeleteDevice removes the given Rubus `Device` from the database.
DeleteUser removes the given Rubus `User` from the database.
GetAllDevices returns all the `Device` from the database.
GetAllUsers returns all the `User` from the database.
GetDevice returns the `Device` with the given `deviceID` from the database.
GetUser returns the `User` with the given `uid` from the database.
Login checks if the given credentials are valid or not.
NewBadRequestError return an error 400 JSON formatted.
NewForbiddenError return an error 403 JSON formatted.
NewInternalServerError returns an error 500 JSON formatted.
NewUnauthorizedError return an error 401 JSON formatted.
ReleaseDevice sets the `owner` of the `Device` as nil, if it is the current `owner` which is modifying it.
SwitchDevicePower inverse the `isTurnedOn` field of the `Device` with the given `deviceID`.
UpdateUser modifies the `User` with the given `uid` in the database, with some validations.

# Constants

Values for `Role` enum.
Values for `Role` enum.

# Structs

Claims is the JWT claims.
Device contains the information about a device.
JSONError is the struct representing a JSON formatted error.
JWT is used for swagger doc only.
NewUser is the model sent to create a new `User`.
PutUser is only use to document the PUT `User` endpoint.
User is the `User` model in the database.

# Type aliases

Role is an enum which spcify the role of a `User`.