controllers

package
v0.0.0-...-fe735be Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateTask

func CreateTask(c *gin.Context)

CreateTask ...

func CreateUser

func CreateUser(c *gin.Context)

CreateUser ...

func DeleteTask

func DeleteTask(c *gin.Context)

DeleteTask ...

func DeleteUser

func DeleteUser(c *gin.Context)

DeleteUser ...

func GetTaskByID

func GetTaskByID(c *gin.Context)

GetTaskByID godoc

func GetTasks

func GetTasks(c *gin.Context)

GetTasks godoc @Security Authorization Token

func GetUserByID

func GetUserByID(c *gin.Context)

GetUserByID godoc @Summary Retrieves user based on given ID @Description get User by ID @Produce json @Param id path integer true "User ID" @Success 200 {object} users.User @Router /api/users/{id} [get] @Security Authorization Token

func GetUsers

func GetUsers(c *gin.Context)

GetUsers godoc @Summary Retrieves users based on query @Description Get Users @Produce json @Param username query string false "Username" @Param firstname query string false "Firstname" @Param lastname query string false "Lastname" @Success 200 {array} []users.User @Router /api/users [get] @Security Authorization Token

func Login

func Login(c *gin.Context)

Login ...

func UpdateTask

func UpdateTask(c *gin.Context)

UpdateTask ...

func UpdateUser

func UpdateUser(c *gin.Context)

UpdateUser ...

Types

type LoginController

type LoginController interface {
	Login(ctx *gin.Context) string
}

LoginController contorler interface

type LoginCredentials

type LoginCredentials struct {
	Email    string `form:"email"`
	Password string `form:"password"`
}

LoginCredentials credential

type LoginInput

type LoginInput struct {
	Username string `json:"username" binding:"required"`
	Password string `json:"password" binding:"required"`
}

LoginInput ...

type LoginResponse

type LoginResponse struct {
	Username string `form:"username"`
	Token    string `form:"token"`
}

LoginResponse credential

type UserInput

type UserInput struct {
	Username  string `json:"username" binding:"required"`
	Lastname  string `json:"lastname"`
	Firstname string `json:"firstname"`
	Password  string `json:"password" binding:"required"`
	Role      string `json:"role"`
}

UserInput ...

Jump to

Keyboard shortcuts

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