jwt

package
v0.0.0-...-0e611fa Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JWTManager

type JWTManager struct {
	// contains filtered or unexported fields
}

func NewJWTManager

func NewJWTManager(secret string, duration time.Duration) *JWTManager

func (*JWTManager) GenerateJWT

func (manager *JWTManager) GenerateJWT(userId string) (string, error)

func (*JWTManager) VerifyToken

func (manager *JWTManager) VerifyToken(accessToken string) (*Payload, error)

VerifyToken verifies given token

type Payload

type Payload struct {
	UserId string `json:"user_id"`
	jwt.StandardClaims
}

Jump to

Keyboard shortcuts

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