auth

package
v0.0.0-...-13393c4 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

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

func InitAuth

func InitAuth() (a *Auth)

func (*Auth) AppAuthMiddleware

func (a *Auth) AppAuthMiddleware() gin.HandlerFunc

func (*Auth) GetAppUsedID

func (a *Auth) GetAppUsedID(c *gin.Context) (userID uint, err error)

func (*Auth) GetJwtUserInfo

func (a *Auth) GetJwtUserInfo(c *gin.Context, key string) (iVal interface{}, err error)

func (*Auth) GetUserIDMiddleware

func (a *Auth) GetUserIDMiddleware() gin.HandlerFunc

func (*Auth) NewAppJwt

func (a *Auth) NewAppJwt(uid uint, isAdminLogin ...bool) (string, error)

type JWToken

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

func (*JWToken) JwtCreate

func (token *JWToken) JwtCreate(mc jwt.MapClaims) (string, error)

func (*JWToken) JwtVerify

func (token *JWToken) JwtVerify(reqToken string) (claims jwt.MapClaims, err error)

func (*JWToken) Param

func (token *JWToken) Param(reqToken, key string) (interface{}, error)

Jump to

Keyboard shortcuts

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