Documentation ¶
Index ¶
Constants ¶
const ( InvalidParam errCode = "invalid_param" InternalServerError = "internal_server_error" NotFound = "not_found" )
Error codes
Variables ¶
var HealthcheckSelfValidator *jsval.JSVal
var M *jsval.ConstraintMap
var R0 jsval.Constraint
var R1 jsval.Constraint
var R2 jsval.Constraint
var R3 jsval.Constraint
var R4 jsval.Constraint
var R5 jsval.Constraint
var TodoCreateValidator *jsval.JSVal
var TodoInstancesValidator *jsval.JSVal
var TodoSelfValidator *jsval.JSVal
var UserCreateValidator *jsval.JSVal
var UserSelfValidator *jsval.JSVal
Functions ¶
This section is empty.
Types ¶
type Error ¶
type Error struct { Code errCode `json:"code,omitempty"` Description string `json:"description,omitempty"` }
Error api errror
func NewInternalServerError ¶
NewInternalServerError create internal server error
func NewNotFoundError ¶
NewNotFoundError create internal server error
type Healthcheck ¶
type Healthcheck struct {
Message string `json:"message"`
}
Healthcheck struct for healthcheck resource
type HealthcheckSelfResponse ¶
type HealthcheckSelfResponse Healthcheck
HealthcheckSelfResponse struct for healthcheck GET: /healthcheck
type Todo ¶
type Todo struct { ID string `json:"id"` Name string `json:"name"` StartedAt time.Time `json:"startedAt"` StoppedAt time.Time `json:"stoppedAt,omitempty"` TotalDuration int64 `json:"totalDuration"` }
Todo struct for todo resource
type TodoCreateRequest ¶
TodoCreateRequest struct for todo POST: /todos
type TodoCreateResponse ¶
type TodoCreateResponse Todo
TodoCreateResponse struct for todo POST: /todos
type TodoInstancesRequest ¶
type TodoInstancesRequest struct { Limit int64 `json:"limit,omitempty" schema:"limit"` Offset int64 `json:"offset,omitempty" schema:"offset"` }
TodoInstancesRequest struct for todo GET: /todos
type TodoInstancesResponse ¶
type TodoInstancesResponse []Todo
TodoInstancesResponse struct for todo GET: /todos
type TodoSelfResponse ¶
type TodoSelfResponse Todo
TodoSelfResponse struct for todo GET: /todos/{(#/definitions/todo/definitions/identity)}
type User ¶
type User struct { Email string `json:"email"` ID string `json:"id"` Username string `json:"username"` }
User struct for user resource
type UserCreateRequest ¶
type UserCreateRequest struct { Email string `json:"email"` Password string `json:"password,omitempty"` Username string `json:"username"` }
UserCreateRequest struct for user POST: /users
type UserCreateResponse ¶
type UserCreateResponse struct { Token string `json:"token,omitempty"` User *User `json:"user,omitempty"` }
UserCreateResponse struct for user POST: /users