Documentation ¶
Index ¶
- Constants
- Variables
- func New(c *controller.Controller) *gin.Engine
- func NewTest(t *testing.T) (*controller.Controller, *httpexpect.Expect, func())
- type Handler
- func (h *Handler) CreateAPIKey(ctx *gin.Context)
- func (h *Handler) CreateUser(ctx *gin.Context)
- func (h *Handler) CreateVehicle(ctx *gin.Context)
- func (h *Handler) DeleteAPIKey(ctx *gin.Context)
- func (h *Handler) DeleteUser(ctx *gin.Context)
- func (h *Handler) DeleteVehicle(ctx *gin.Context)
- func (h *Handler) Echo(ctx *gin.Context)
- func (h *Handler) Login(ctx *gin.Context)
- func (h *Handler) Map(ctx *gin.Context)
- func (h *Handler) QueryAPIKeys(ctx *gin.Context)
- func (h *Handler) QueryUsers(ctx *gin.Context)
- func (h *Handler) QueryVehicles(ctx *gin.Context)
- func (h *Handler) UpdateUser(ctx *gin.Context)
- func (h *Handler) UpdateVehicle(ctx *gin.Context)
- type JWTResponse
- type Status
Constants ¶
View Source
const ( EchoRoute = "/echo" MapRoute = "/map" LoginRoute = "/login" UserRoute = "/user" UserRouteWithParams = UserRoute + "/:" + UUIDParam VehicleRoute = "/vehicle" VehicleRouteWithParams = VehicleRoute + "/:" + UUIDParam APIKeyRoute = "/keys" APIKeyRouteWithParams = APIKeyRoute + "/:" + UUIDParam LocationRoute = "/location" ExportRoute = "/export" RoutePlanningRoute = "/route" )
Vehicles API keys can: - [ ] Notify location - [ ] Plan route
Public - [X] Download map - [X] Login
Admin user can: - [X] CRUD users - [X] CRUD vehicles - [X] CRUD API keys - [ ] Monitor location - [ ] Export data
Manager user can: - [ ] Monitor location - [ ] Export data
View Source
const (
CredentialsKey = "CREDENTIALS_KEY"
)
View Source
const (
RootRoute = "/api"
)
View Source
const (
UUIDParam = "uuid"
)
Variables ¶
Functions ¶
func New ¶
func New(c *controller.Controller) *gin.Engine
func NewTest ¶
func NewTest(t *testing.T) (*controller.Controller, *httpexpect.Expect, func())
Types ¶
type Handler ¶
type Handler struct {
Controller *controller.Controller
}
func (*Handler) CreateAPIKey ¶
func (*Handler) CreateUser ¶
func (*Handler) CreateVehicle ¶
func (*Handler) DeleteAPIKey ¶
func (*Handler) DeleteUser ¶
func (*Handler) DeleteVehicle ¶
func (*Handler) QueryAPIKeys ¶
func (*Handler) QueryUsers ¶
func (*Handler) QueryVehicles ¶
func (*Handler) UpdateUser ¶
func (*Handler) UpdateVehicle ¶
type JWTResponse ¶
type JWTResponse struct {
JWT string `json:"jwt"`
}
Source Files ¶
Click to show internal directories.
Click to hide internal directories.