Documentation ¶
Index ¶
- Constants
- func Accepted(ctx iris.Context, response interface{})
- func BadRequest(ctx iris.Context, validationsErros []ValidationError)
- func Conflict(ctx iris.Context, message string)
- func Created(ctx iris.Context, response interface{})
- func DeleteVehicle(ctx iris.Context)
- func Forbidden(ctx iris.Context)
- func GetCurrentUserFromContext(ctx iris.Context) *users.UserClaims
- func GetUser(ctx iris.Context)
- func GetUserVehicles(ctx iris.Context)
- func GetVehicle(ctx iris.Context)
- func GetVehicleByID(ctx iris.Context)
- func InternalServerError(ctx iris.Context, code string, err error)
- func Login(ctx iris.Context)
- func NoContent(ctx iris.Context)
- func NotFound(ctx iris.Context, message string)
- func Ok(ctx iris.Context, response interface{})
- func PaginateTraces(ctx iris.Context)
- func PatchUser(ctx iris.Context)
- func PatchVehicle(ctx iris.Context)
- func PostTrace(ctx iris.Context)
- func PostTraceFromCSV(ctx iris.Context)
- func PostVehicle(ctx iris.Context)
- func PutVehicle(ctx iris.Context)
- func Register(ctx iris.Context)
- func Unauthorized(ctx iris.Context, validationsErros []ValidationError)
- func UnprocessableEntity(ctx iris.Context, errs validator.ValidationErrors)
- type ValidationError
Constants ¶
const ErrorInsufficientPermission = "INSUFFICIENT_PERMISSION"
ErrorInsufficientPermission -> INSUFFICIENT_PERMISSION
const ErrorInvalidCredentials = "INVALID_CREDENTIALS"
ErrorInvalidCredentials -> INVALID_CREDENTIALS
const ErrorInvalidField = "INVALID_FIELD"
ErrorInvalidField -> INVALID_FIELD
const ErrorInvalidParameter = "INVALID_PARAMETER"
ErrorInvalidParameter -> INVALID_PARAMETER
const ErrorInvalidPayload = "INVALID_JSON"
ErrorInvalidPayload -> INVALID_JSON
const ErrorInvalidRequest = "INVALID_REQUEST"
ErrorInvalidRequest -> INVALID_REQUEST
const ErrorNotFound = "NOT_FOUND"
ErrorNotFound -> NOT_FOUND
const ErrorUnexpectedError = "UNEXPECTED_ERROR"
ErrorUnexpectedError -> UNEXPECTED_ERROR
Variables ¶
This section is empty.
Functions ¶
func BadRequest ¶
func BadRequest(ctx iris.Context, validationsErros []ValidationError)
BadRequest -> stop with 400
func GetCurrentUserFromContext ¶
func GetCurrentUserFromContext(ctx iris.Context) *users.UserClaims
GetCurrentUserFromContext -> retrive user data from context
func GetUserVehicles ¶
func GetUserVehicles(ctx iris.Context)
GetUserVehicles -> GET /v1/users/{id}/vehicles
func InternalServerError ¶
InternalServerError -> stop with 500
func PaginateTraces ¶
func PaginateTraces(ctx iris.Context)
PaginateTraces -> GET /vehicles/{id}/traces?page=1&page_size=50
func PatchUser ¶
func PatchUser(ctx iris.Context)
PatchUser -> GET /v1/users/{id}/active | /v1/users/{id}/inactive
func PatchVehicle ¶
func PatchVehicle(ctx iris.Context)
PatchVehicle -> PATCH /v1/vehicles/{id}/active | /v1/vehicles/{id}/active
func PostTraceFromCSV ¶
func PostTraceFromCSV(ctx iris.Context)
PostTraceFromCSV -> /vehicles/{id}/traces/upload
func Unauthorized ¶
func Unauthorized(ctx iris.Context, validationsErros []ValidationError)
Unauthorized -> stop with 401
func UnprocessableEntity ¶
func UnprocessableEntity(ctx iris.Context, errs validator.ValidationErrors)
UnprocessableEntity -> stop with 422
Types ¶
type ValidationError ¶
ValidationError -> represent error
func MakeValidationError ¶
func MakeValidationError(errorCode string, errorMessage string) []ValidationError
MakeValidationError -> mapping validator to json
func MakeValidationErrors ¶
func MakeValidationErrors(errs validator.ValidationErrors) []ValidationError
MakeValidationErrors -> mapping validator to json