jwt

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JWT

type JWT struct {
	SignKey []byte
}

func NewJWT

func NewJWT(signKey []byte) *JWT

func (*JWT) Create

func (pkg *JWT) Create(claims jwt.Claims) (tokenString string, err error)

func (*JWT) Parse

func (pkg *JWT) Parse(token string) (tkn *jwt.Token, err error)

func (*JWT) Valid

func (pkg *JWT) Valid(token string) (valid bool, err error)

type UserClaim

type UserClaim struct {
	jwt.StandardClaims
	UserId          int64    `json:"user_id"`
	IpAddr          string   `json:"ip"`
	CompanyIds      []int64  `json:"company_ids"`
	PermissionCodes []string `json:"permission_codes"`
	ExpiresAt       int64    `json:"exp"`
}

Jump to

Keyboard shortcuts

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