jwtoken

package
v0.0.0-...-398e551 Latest Latest
Warning

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

Go to latest
Published: May 21, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JwtClaims

type JwtClaims struct {
	jwt.StandardClaims
	UserId int64
	Email  string
}

type JwtToken

type JwtToken interface {
	ParseToken(accessToken string) (*JwtClaims, error)
	GenerateToken(user *models.User) (string, error)
}

type JwtWrapper

type JwtWrapper struct {
	SecretKey string
	Issuer    string
	TokenTTL  time.Duration
}

func NewJwtWrapper

func NewJwtWrapper(secretKey string, issuer string, tokenTTL time.Duration) *JwtWrapper

func (*JwtWrapper) GenerateToken

func (jw *JwtWrapper) GenerateToken(user *models.User) (string, error)

func (*JwtWrapper) ParseToken

func (jw *JwtWrapper) ParseToken(accessToken string) (*JwtClaims, error)

Directories

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

Jump to

Keyboard shortcuts

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