Documentation ¶
Index ¶
- func AuthMiddleware(db *gorm.DB) gin.HandlerFunc
- func CreateTodo(c *gin.Context)
- func CreateTodoList(c *gin.Context)
- func CreateUser(c *gin.Context)
- func DefineRoutes(db *gorm.DB, r *gin.Engine)
- func DeleteTodo(c *gin.Context)
- func DeleteTodoList(c *gin.Context)
- func DeleteUser(c *gin.Context)
- func FacebookLogin(c *gin.Context)
- func FacebookLoginCallback(c *gin.Context)
- func GetTodo(c *gin.Context)
- func GetTodoList(c *gin.Context)
- func GetTodoLists(c *gin.Context)
- func GetTodos(c *gin.Context)
- func GetUser(c *gin.Context)
- func GetUsers(c *gin.Context)
- func Login(c *gin.Context)
- func OptionsLogin(c *gin.Context)
- func OptionsTodo(c *gin.Context)
- func OptionsTodoList(c *gin.Context)
- func OptionsUser(c *gin.Context)
- func TodoGraphql(c *gin.Context)
- func TodoListGraphql(c *gin.Context)
- func UpdateTodo(c *gin.Context)
- func UpdateTodoList(c *gin.Context)
- func UpdateUser(c *gin.Context)
- func UserGraphql(c *gin.Context)
- type ErrorSchema
- type LoginSchema
- type TokenSchema
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthMiddleware ¶
func AuthMiddleware(db *gorm.DB) gin.HandlerFunc
func CreateTodo ¶
Create godoc @Summary Create a TODO in a specific TODO list @Schemes @Description Returns an newly created TODO in a specific TODO list @Tags TODO @Accept json @Produce json @Param listID path string true "ID of a TODO list" @Param body body models.Todo true "TODO" @Success 200 {object} models.Todo @Failure 401 {object} ErrorSchema @Failure 500 {object} ErrorSchema @Security HttpBearer @Router /list/{listID}/todo/ [post]
func CreateTodoList ¶
Create godoc @Summary Create a TODO list @Schemes @Description Returns an newly created TODO list @Tags TODO list @Accept json @Produce json @Param body body models.TodoList true "TODO list" @Success 200 {object} models.TodoList @Failure 401 {object} ErrorSchema @Failure 500 {object} ErrorSchema @Security HttpBearer @Router /list/ [post]
func CreateUser ¶
Create godoc @Summary Create a user @Schemes @Description Returns an newly created user @Tags registration @Accept json @Produce json @Param body body models.User true "User object" @Success 200 {object} models.User @Failure 401 {object} ErrorSchema @Failure 500 {object} ErrorSchema @Router /user/ [post]
func DeleteTodo ¶
Create godoc @Summary Delete a TODO from a specific TODO list @Schemes @Description Deletes a TODO from a specific TODO list @Tags TODO @Accept json @Produce json @Param listID path string true "ID of a TODO list" @Param todoID path string true "ID of a TODO" @Success 200 {object} models.Todo @Failure 401 {object} ErrorSchema @Failure 500 {object} ErrorSchema @Security HttpBearer @Router /list/{listID}/todo/{todoID}/ [delete]
func DeleteTodoList ¶
Create godoc @Summary Delte a TODO list @Schemes @Description Deletes a particular TODO list by its ID @Tags TODO list @Accept json @Produce json @Param listID path string true "ID of a TODO list" @Success 200 {object} models.TodoList @Failure 401 {object} ErrorSchema @Failure 500 {object} ErrorSchema @Security HttpBearer @Router /list/{listID}/ [delete]
func DeleteUser ¶
Create godoc @Summary Delete a user @Schemes @Description Deletes a user by its ID @Tags users @Accept json @Produce json @Param userID path string true "ID of a User" @Success 204 {object} models.User @Failure 401 {object} ErrorSchema @Failure 500 {object} ErrorSchema @Security HttpBearer @Router /user/{userID}/ [delete]
func FacebookLogin ¶
func FacebookLoginCallback ¶
func GetTodo ¶
Create godoc @Summary Get a TODO in a specific TODO list @Schemes @Description Returns a TODO in a specific TODO list @Tags TODO @Accept json @Produce json @Param listID path string true "ID of a TODO list" @Param todoID path string true "ID of a TODO" @Success 200 {object} models.Todo @Failure 401 {object} ErrorSchema @Failure 500 {object} ErrorSchema @Security HttpBearer @Router /list/{listID}/todo/{todoID}/ [get]
func GetTodoList ¶
Create godoc @Summary Get a TODO list @Schemes @Description Returns a particular TODO list by its ID @Tags TODO list @Accept json @Produce json @Param listID path string true "ID of a TODO list" @Success 200 {object} models.TodoList @Failure 401 {object} ErrorSchema @Failure 500 {object} ErrorSchema @Security HttpBearer @Router /list/{listID}/ [get]
func GetTodoLists ¶
Create godoc @Summary Get a TODO lists @Schemes @Description Returns TODO lists @Tags TODO list @Accept json @Produce json @Success 200 {object} []models.TodoList @Failure 401 {object} ErrorSchema @Failure 500 {object} ErrorSchema @Security HttpBearer @Router /list/ [get]
func GetTodos ¶
Create godoc @Summary Get TODOs in a specific TODO list @Schemes @Description Returns a list of TODOs in a specific TODO list @Tags TODO @Accept json @Produce json @Param listID path string true "ID of a TODO list" @Success 200 {object} []models.Todo @Failure 401 {object} ErrorSchema @Failure 500 {object} ErrorSchema @Security HttpBearer @Router /list/{listID}/todo/ [get]
func GetUser ¶
Create godoc @Summary Get a user @Schemes @Description Returns a user by its ID @Tags users @Accept json @Produce json @Param userID path string true "ID of a User" @Success 200 {object} models.User @Failure 401 {object} ErrorSchema @Failure 500 {object} ErrorSchema @Security HttpBearer @Router /user/{userID}/ [get]
func GetUsers ¶
Create godoc @Summary Get list of users @Schemes @Description Returns a list of users @Tags users @Accept json @Produce json @Success 200 {object} []models.User @Failure 401 {object} ErrorSchema @Failure 500 {object} ErrorSchema @Security HttpBearer @Router /user/ [get]
func Login ¶
Create godoc @Summary Create auth token @Schemes @Description Returns an newly created authentication token @Tags auth @Accept json @Produce json @Param body body LoginSchema true "User credentials" @Success 200 {object} TokenSchema @Failure 401 {object} ErrorSchema @Failure 500 {object} ErrorSchema @Router /auth/login/ [post]
func OptionsLogin ¶
func OptionsTodo ¶
func OptionsTodoList ¶
func OptionsUser ¶
func TodoGraphql ¶
func TodoListGraphql ¶
func UpdateTodo ¶
Create godoc @Summary Update a TODO in a specific TODO list @Schemes @Description Updates and returns a TODO in a specific TODO list @Tags TODO @Accept json @Produce json @Param listID path string true "ID of a TODO list" @Param todoID path string true "ID of a TODO" @Param body body models.Todo true "TODO" @Success 200 {object} models.Todo @Failure 401 {object} ErrorSchema @Failure 500 {object} ErrorSchema @Security HttpBearer @Router /list/{listID}/todo/{todoID}/ [put]
func UpdateTodoList ¶
Create godoc @Summary Update a TODO list @Schemes @Description Updates a particular TODO list by its ID @Tags TODO list @Accept json @Produce json @Param listID path string true "ID of a TODO list" @Param body body models.TodoList true "TODO list" @Success 200 {object} models.TodoList @Failure 401 {object} ErrorSchema @Failure 500 {object} ErrorSchema @Security HttpBearer @Router /list/{listID}/ [put]
func UpdateUser ¶
Create godoc @Summary Update a user @Schemes @Description Updates a user by its ID @Tags users @Accept json @Produce json @Param userID path string true "ID of a User" @Param body body models.User true "User object" @Success 200 {object} models.User @Failure 401 {object} ErrorSchema @Failure 500 {object} ErrorSchema @Security HttpBearer @Router /user/{userID}/ [put]
func UserGraphql ¶
Types ¶
type ErrorSchema ¶
type ErrorSchema struct {
Error string `form:"error" json:"error" binding:"required"`
}
type LoginSchema ¶
type TokenSchema ¶
type TokenSchema struct {
Token string `form:"token" json:"token" binding:"required"`
}