pkg

package
v0.0.0-...-2a7cc9c Latest Latest
Warning

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

Go to latest
Published: May 28, 2025 License: MIT Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package pkg jwt.go Author: 王辉 Created: 2025-03-27 01:40 之前没考虑到时区,先默认+8区,以后做国际化的时候加上 要把密钥转换成[]byte类型

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenJwtToken

func GenJwtToken(userID uint, duration time.Duration, key string) (string, string, error)

GenJwtToken 生成 JWT

func ParseToken

func ParseToken(tokenString, key string) (*jwt.Token, error)

ParseToken 解析 JWT,并检查是否过期,同时返回可读的过期时间

func PushClient

func PushClient(consuls string) v2.PushClient

func UserClient

func UserClient(consuls string) v1.UserClient

Types

This section is empty.

Jump to

Keyboard shortcuts

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