handlers

package
v0.0.0-...-1f850de Latest Latest
Warning

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

Go to latest
Published: May 27, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateTodo

func CreateTodo(c *gin.Context)

CreateTodo creates a todo.

POST /todos

func DeleteTodoByID

func DeleteTodoByID(c *gin.Context)

DeleteTodo deletes a todo.

DELETE /todos/:id

func GetTodoByID

func GetTodoByID(c *gin.Context)

GetTodoByID returns a todo given the ID.

GET /todos/:id

func GetTodos

func GetTodos(c *gin.Context)

GetTodos returns all todos owned by the currently logged-in user. Actually, it returns all todos for now, but authorization will soon be implemented.

GET /todos

func GetTodosByOwnerID

func GetTodosByOwnerID(c *gin.Context)

GetTodosByOwnerID returns todos given the owner ID.

GET /users/:id/todos

func GetUserByID

func GetUserByID(c *gin.Context)

GetUserByID returns a user given the ID.

GET /users/:id

func GetUserByUsername

func GetUserByUsername(c *gin.Context)

GetUserByUsername returns a user given the username as a query parameter.

GET /users?username=:username GET /users is Forbidden

func LoginUser

func LoginUser(c *gin.Context)

Is the user logged in?

GET /users/login

This is just a dummy endpoint which relies on the authentication middleware to handle login but informs the client whether user is logged in.

func UpdateTodoByID

func UpdateTodoByID(c *gin.Context)

UpdateTodoByID updates a todo.

PUT /todos/:id

Types

This section is empty.

Jump to

Keyboard shortcuts

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