auth

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2024 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AuthBearer = "Bearer "
)

Variables

This section is empty.

Functions

This section is empty.

Types

type InjectorFunc

type InjectorFunc func(ctx *gin.Context, ls *LoginStatus) (err error)

type LoginStatus

type LoginStatus struct {
	Token string
	Err   error
	Role  Role
	State State
	// contains filtered or unexported fields
}

LoginStatus

func (*LoginStatus) GetID

func (ls *LoginStatus) GetID(idname string) uint

func (*LoginStatus) SetID

func (ls *LoginStatus) SetID(idname string, id uint)

type LoginWay

type LoginWay uint8 // 登录方式
const (
	LoginWayUnknown LoginWay = 0
	// LoginWayEmail 邮箱+密码
	LoginWayEmail LoginWay = 1
	// LoginWayPhone 手机号+验证码
	LoginWayPhone LoginWay = 2
	// LoginWayWxWeb 微信网页端
	LoginWayWxWeb LoginWay = 3
	// LoginWayWxMp 微信公众号
	LoginWayWxMp LoginWay = 4
	// LoginWayWxMini 微信小程序
	LoginWayWxMini LoginWay = 5
	// LoginWayGithub github
	LoginWayGithub LoginWay = 6
	// LoginWayWorkWechat 企业微信
	LoginWayWorkWechat LoginWay = 7
)

type Role

type Role int
const (
	RoleNil Role = iota
	// RoleUser 普通用户
	RoleUser
	// RoleEmployee 运营用户
	RoleEmployee
	// RoleCustomer 客户
	RoleCustomer
)

type State

type State int
const (
	StateNil State = iota
	StateSucc
	StateParseFailed
	StateInvalidToken
	StateInvalidUser
)

Jump to

Keyboard shortcuts

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