user

package
v0.0.0-...-64e84b0 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2021 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteAPIKey

func DeleteAPIKey(c *gin.Context)

Delete API Key godoc @Summary Delete API Key @Description Delete API Key @Tags user @Accept json,xml,application/x-yaml @Produce json,xml,application/x-yaml @Param id path string true "API Key ID" @Success 204 @Failure 403 {object} response.R @Failure 404 {object} response.R @Failure 500 {object} response.R @Router /v1/user/apikey/{id} [delete]

func DeleteLogout

func DeleteLogout(c *gin.Context)

Logout from account godoc @Summary Logout from account @Description Logout from account @Tags user @Accept json,xml,application/x-yaml @Produce json,xml,application/x-yaml @Success 201 @Failure 500 {object} response.R @Router /v1/user/delete [delete,get]

func GetIndex

func GetIndex(c *gin.Context)

func PostAPIKey

func PostAPIKey(c *gin.Context)

Create API Key godoc @Summary Create API Key @Description Create API Key @Tags user @Accept json,xml,application/x-yaml @Produce json,xml,application/x-yaml @Param dto body user.APIKeyDTO true @Success 201 {object} user.APIKeyResponse @Failure 400 {object} response.R @Failure 403 {object} response.R @Failure 500 {object} response.R @Router /v1/user/apikey [post]

func PostForgot

func PostForgot(c *gin.Context)

Request and send forgot password verification code godoc @Summary Request and send forgot password verification code @Description Request and send forgot password verification code @Tags user @Accept json,xml,application/x-yaml @Produce json,xml,application/x-yaml @Param dto body user.ForgotDTO true @Success 201 @Failure 400 {object} response.R @Failure 500 {object} response.R @Router /v1/user/forgot [post]

func PostForgotVerify

func PostForgotVerify(c *gin.Context)

Check verify code and set new password godoc @Summary Request and send forgot password verification code @Description Request and send forgot password verification code @Tags user @Accept json,xml,application/x-yaml @Produce json,xml,application/x-yaml @Param dto body user.ForgotVerifyDTO true @Success 204 @Failure 400 {object} response.R @Failure 403 {object} response.R @Failure 500 {object} response.R @Router /v1/user/forgot-verify [post]

func PostLogin

func PostLogin(c *gin.Context)

Login to account godoc @Summary Login to account @Description Login to account @Tags user @Accept json,xml,application/x-yaml @Produce json,xml,application/x-yaml @Param dto body user.LoginDTO true @Success 201 @Failure 400 {object} response.R @Failure 403 {object} response.R @Failure 500 {object} response.R @Router /v1/user/login [post]

func PostRegister

func PostRegister(c *gin.Context)

Register godoc @Summary Register a new user @Description Register a new user @Tags user @Accept json,xml,application/x-yaml @Produce json,xml,application/x-yaml @Param dto body user.RegisterDTO true "Register DTO" @Success 201 @Failure 409 {object} response.R @Failure 400 {object} response.R @Failure 500 {object} response.R @Router /v1/user/register [post]

func PostVerify

func PostVerify(c *gin.Context)

Verify account godoc @Summary Verify account @Description Verify account @Tags user @Accept json,xml,application/x-yaml @Produce json,xml,application/x-yaml @Param dto body user.VerifyDTO true "Verify account" @Success 201 @Failure 400 {object} response.R @Failure 404 {object} response.R @Failure 500 {object} response.R @Router /v1/user/verify [post]

Types

type APIKeyDTO

type APIKeyDTO struct {
	Name      string    `yaml:"name" xml:"name" json:"name" binding:"required"`
	ExpiresAt time.Time `yaml:"expires_at" xml:"expires_at" json:"expires_at" binding:"required"`
}

type APIKeyResponse

type APIKeyResponse struct {
	Name      string    `yaml:"name" xml:"name" json:"name"`
	Token     string    `yaml:"token" xml:"token" json:"token"`
	ExpiresAt time.Time `yaml:"expires_at" xml:"expires_at" json:"expires_at"`
}

type ForgotDTO

type ForgotDTO struct {
	Email string `yaml:"email" xml:"email" json:"email" binding:"required"`
}

type ForgotVerifyDTO

type ForgotVerifyDTO struct {
	Email    string `yaml:"email" xml:"email" json:"email" binding:"required"`
	Code     string `yaml:"code" xml:"code" json:"code" binding:"required"`
	Password string `yaml:"password" xml:"password" json:"password" binding:"omitempty,password_validator"`
}

type LoginDTO

type LoginDTO struct {
	Email    string `json:"email" binding:"required"`
	Password string `json:"password" binding:"required"`
}

type RegisterDTO

type RegisterDTO struct {
	Firstname string `yaml:"firstname" xml:"firstname" json:"firstname" binding:"required"`
	Lastname  string `yaml:"lastname" xml:"lastname" json:"lastname" binding:"required"`
	Email     string `yaml:"email" xml:"email" json:"email" binding:"required"`
	Password  string `yaml:"password" xml:"password" json:"password" binding:"required,password_validator"`
	Address1  string `yaml:"address1" xml:"address1" json:"address1" binding:"required"`
	Address2  string `yaml:"address2" xml:"address2" json:"address2" binding:"-"`
	City      string `yaml:"city" xml:"city" json:"city" binding:"required"`
	State     string `yaml:"state" xml:"state" json:"state" binding:"required"`
	Zip       string `yaml:"zip" xml:"zip" json:"zip" binding:"required"`
	Country   string `yaml:"country" xml:"country" json:"country" binding:"required"`
}

type VerifyDTO

type VerifyDTO struct {
	Code  string `yaml:"code" xml:"code" json:"code" binding:"required"`
	Email string `yaml:"email" xml:"email" json:"email" binding:"required"`
}

Jump to

Keyboard shortcuts

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