controllers

package
v0.0.0-...-15cfdef Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateUser

func CreateUser(c *gin.Context)

func DeleteUser

func DeleteUser(c *gin.Context)

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)

func UpdateUser

func UpdateUser(c *gin.Context)

Types

type LoginInput

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

type UserInput

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

Jump to

Keyboard shortcuts

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