controller

package
v0.0.0-...-6604dc5 Latest Latest
Warning

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

Go to latest
Published: May 13, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateNewAccessToken

func GenerateNewAccessToken(userID int, isAdmin bool) (string, error)

func GeneratePasswordHash

func GeneratePasswordHash(password []byte) (string, error)

func GetNewAccessToken

func GetNewAccessToken(c *fiber.Ctx) error

GetNewAccessToken method for create a new access token.

@Description	Create a new access token.
@Summary		create a new access token
@Tags			Token
@Accept			json
@Produce		json
@Param			login			body		dto.Auth		true	"Request for token"
@Failure		400,404,401,500	{object}	ErrorResponse
@Success		200				{object}	TokenResponse
@Router			/v1/login [post]

func GetPagination

func GetPagination(c *fiber.Ctx) (pageNo, pageSize int)

func GetUsers

func GetUsers(ctx *fiber.Ctx) error

func IsValidPassword

func IsValidPassword(hash, password []byte) bool

Types

type ErrorResponse

type ErrorResponse struct {
	Ok      string `json:"ok"`
	Detail  string `json:"detail"`
	Message string `json:"message"`
}

type TokenResponse

type TokenResponse struct {
	AccessToken string `json:"access_token"`
	Message     string `json:"message"`
}

Jump to

Keyboard shortcuts

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