services

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type AuthOption

type AuthOption struct {
	SigningMethod jwt.SigningMethod
	SigningKey    interface{}
	KeyFunc       jwt.Keyfunc
	Expired       int
	TokenType     string
}

type AuthService

type AuthService interface {
	ParseUserID(tokenString string) (string, error)
	GetToken(string) string
}

func InitAuth

func InitAuth(opt *AuthOption) AuthService

New 创建认证实例

func NewAuthService

func NewAuthService() AuthService

type JwtAuthService

type JwtAuthService struct {
	Opts  *AuthOption
	Store *redis.Store
}

func (*JwtAuthService) GetToken

func (a *JwtAuthService) GetToken(auth string) string

func (*JwtAuthService) ParseUserID

func (a *JwtAuthService) ParseUserID(tokenString string) (string, error)

ParseUserID 解析用户ID

Jump to

Keyboard shortcuts

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