auth

package
v0.0.0-...-13b8838 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

@Author Eric @Date 2024/9/4 16:58:00 @Desc

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthToken

type AuthToken struct {
	SecretKey []byte //base64的
	Salt      string
}

func NewAuthToken

func NewAuthToken(secretKey, salt string) *AuthToken

初始化 AuthToken 类 secretKey是base64的

func (*AuthToken) GenerateToken

func (a *AuthToken) GenerateToken(userID int64, expirationTime int64) (string, error)

生成 Token

func (*AuthToken) ParseToken

func (a *AuthToken) ParseToken(token string) (int64, bool, error)

解析 Token

Jump to

Keyboard shortcuts

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