Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MainController ¶
type MainController struct {
beego.Controller
}
func (*MainController) Get ¶
func (this *MainController) Get()
type TaskController ¶
type TaskController struct {
beego.Controller
}
func (*TaskController) GetTask ¶
func (this *TaskController) GetTask()
Examples:
req: GET /task/1 res: 200 {"ID": 1, "Title": "Buy bread", "Done": true} req: GET /task/42 res: 404 task not found
func (*TaskController) ListTasks ¶
func (this *TaskController) ListTasks()
Example:
req: GET /task/ res: 200 {"Tasks": [ {"ID": 1, "Title": "Learn Go", "Done": false}, {"ID": 2, "Title": "Buy bread", "Done": true} ]}
func (*TaskController) NewTask ¶
func (this *TaskController) NewTask()
Examples:
req: POST /task/ {"Title": ""} res: 400 empty title req: POST /task/ {"Title": "Buy bread"} res: 200
func (*TaskController) UpdateTask ¶
func (this *TaskController) UpdateTask()
Example:
req: PUT /task/1 {"ID": 1, "Title": "Learn Go", "Done": true} res: 200 req: PUT /task/2 {"ID": 2, "Title": "Learn Go", "Done": true} res: 400 inconsistent task IDs
Click to show internal directories.
Click to hide internal directories.