token

package
v0.0.0-...-db3ee06 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const ExpireCount = 2
View Source
const ExpireRefreshCount = 168

Variables

This section is empty.

Functions

This section is empty.

Types

type JwtCustomClaims

type JwtCustomClaims struct {
	Name string `json:"name"`
	ID   uint   `json:"id"`
	jwt.StandardClaims
}

type JwtCustomRefreshClaims

type JwtCustomRefreshClaims struct {
	ID uint `json:"id"`
	jwt.StandardClaims
}

type Service

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

func NewTokenService

func NewTokenService(cfg *config.Config) *Service

func (*Service) CreateAccessToken

func (tokenService *Service) CreateAccessToken(user *models.User) (accessToken string, exp int64, err error)

func (*Service) CreateRefreshToken

func (tokenService *Service) CreateRefreshToken(user *models.User) (t string, err error)

type ServiceWrapper

type ServiceWrapper interface {
	CreateAccessToken(user *models.User) (accessToken string, exp int64, err error)
	CreateRefreshToken(user *models.User) (t string, err error)
}

Jump to

Keyboard shortcuts

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