jwt

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const ExpiresDuration = 24 * time.Hour

Variables

This section is empty.

Functions

This section is empty.

Types

type Claims

type Claims struct {
	jwt.RegisteredClaims
	UserID   string `json:"user_id"`
	UserName string `json:"user_name"`
}

type Service

type Service struct {
	SecretKey []byte
}

func (*Service) GenerateToken

func (s *Service) GenerateToken(userID string, userName string) (string, error)

func (*Service) VerifyToken

func (s *Service) VerifyToken(tokenString string) (*Claims, error)

Jump to

Keyboard shortcuts

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