jwt

package
v0.0.0-...-087a618 Latest Latest
Warning

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

Go to latest
Published: May 24, 2024 License: Apache-2.0 Imports: 4 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(signKey string) *JwtManager

func (*JwtManager) ReadToken

func (j *JwtManager) ReadToken(duration time.Duration) (string, error)

func (*JwtManager) Verify

func (j *JwtManager) Verify(token string) (*TokenData, error)

func (*JwtManager) WriteToken

func (j *JwtManager) WriteToken(duration time.Duration) (string, error)

type TokenData

type TokenData struct {
	User      string
	Role      string
	ExpiresAt time.Time
}

Jump to

Keyboard shortcuts

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