jwt

package
v0.0.0-...-04f365a Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Jwt = getJwt()

Functions

This section is empty.

Types

type Claims

type Claims struct {
	jwt.RegisteredClaims
	UserID   uuid.UUID `json:"user_id"`
	RoleName string    `json:"role_name"`
}

type JwtInterface

type JwtInterface interface {
	Create(userID uuid.UUID, roleName string) (string, error)
	Decode(tokenString string, claims *Claims) error
}

type JwtStruct

type JwtStruct struct {
	SecretKey   string
	ExpiredTime time.Duration
}

func (*JwtStruct) Create

func (j *JwtStruct) Create(userID uuid.UUID, roleName string) (string, error)

func (*JwtStruct) Decode

func (j *JwtStruct) Decode(tokenString string, claims *Claims) error

Directories

Path Synopsis
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.

Jump to

Keyboard shortcuts

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