users

package module
v0.0.0-...-7477414 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2021 License: MIT Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AuthorizationHeaderExtractor = &request.PostExtractionFilter{
	request.HeaderExtractor{"Authorization"},
	stripBearerPrefixFromTokenString,
}

Functions

func AuthMiddleware

func AuthMiddleware(auto401 bool) gin.HandlerFunc

func UpdateContextUserModel

func UpdateContextUserModel(c *gin.Context, my_user_id uint)

func UserLogin

func UserLogin(c *gin.Context)

func UserRegistration

func UserRegistration(c *gin.Context)

func UsersRegister

func UsersRegister(router *gin.RouterGroup)

Types

type LoginValidator

type LoginValidator struct {
	User struct {
		Email    string `form:"email" json:"email"`
		Password string `form:"password" json:"password"`
	} `json:"user"`
	// contains filtered or unexported fields
}

func (*LoginValidator) Bind

func (self *LoginValidator) Bind(c *gin.Context) error

type UserModel

type UserModel struct {
	ID       uint    `gorm:"primary_key"`
	UserName string  `gorm:"column:username"`
	Email    string  `gorm:"column:email;unique_index"`
	Bio      string  `gorm:"column:bio;size:1024"`
	Image    *string `gorm:"column:image"`
	Password string  `gorm:"column:password;not null"`
}

type UserModelValidator

type UserModelValidator struct {
	User struct {
		Username string `form:"username" json:"username"`
		Email    string `form:"email" json:"email"`
		Password string `form:"password" json:"password"`
		Bio      string `form:"bio" json:"bio"`
		Image    string `form:"image" json:"image"`
	} `json:"user"`
	// contains filtered or unexported fields
}

func (*UserModelValidator) Bind

func (self *UserModelValidator) Bind(c *gin.Context) error

type UserResponse

type UserResponse struct {
	Username string  `json:"username"`
	Email    string  `json:"email"`
	Bio      string  `json:"bio"`
	Image    *string `json:"image"`
	Token    string  `json:"token"`
}

type UserSerializer

type UserSerializer struct {
	// contains filtered or unexported fields
}

func (*UserSerializer) Response

func (self *UserSerializer) Response() UserResponse

Jump to

Keyboard shortcuts

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