auth

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Claims

type Claims struct {
	UpdateDur *jwt.NumericDate `json:"upd,omitempty"` // Token 更新时限
	jwt.RegisteredClaims
}

func (*Claims) Set

func (c *Claims) Set(args ...any) *Claims

Set 设置数据

type Service

type Service struct {
	*jwt.Token
}

Service Auth 服务

func New

func New() *Service

New 新建 Auth 服务

func (*Service) Black

func (s *Service) Black(token string) error

Black 拉黑 Token

func (*Service) Check

func (s *Service) Check(token string, args ...string) (string, string, error)

Check 校验 Token

func (*Service) Init

func (s *Service) Init(args ...services.Service) services.Service

Init 初始化

func (*Service) IsToken

func (s *Service) IsToken(token string) bool

IsToken 判断是否是 Token

func (*Service) Sign

func (s *Service) Sign(args ...any) (string, error)

Sign 签名 Token

Jump to

Keyboard shortcuts

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