iapi

package
v0.0.0-...-96c97c1 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2017 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InvalidParam        errCode = "invalid_param"
	Unauthorized                = "unauthorized"
	InternalServerError         = "internal_server_error"
	NotFound                    = "not_found"
)

Error codes

Variables

View Source
var HealthcheckSelfValidator *jsval.JSVal
View Source
var TodoCreateValidator *jsval.JSVal
View Source
var TodoInstancesValidator *jsval.JSVal
View Source
var TodoSelfValidator *jsval.JSVal
View Source
var UserCreateValidator *jsval.JSVal
View Source
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

func NewInternalServerError() (int, Error)

NewInternalServerError create internal server error

func NewNotFoundError

func NewNotFoundError() (int, Error)

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

type TodoCreateRequest struct {
	Name   string `json:"name"`
	UserID string `json:"userId,omitempty"`
}

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

type UserSelfResponse

type UserSelfResponse User

UserSelfResponse struct for user GET: /users/me

Jump to

Keyboard shortcuts

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