token

package
v0.0.0-...-7d38a10 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessDetails

type AccessDetails struct {
	AccessUuid string
	UserId     int64
}

type Details

type Details struct {
	AccessToken    string
	RefreshToken   string
	AccessUuid     string
	RefreshUuid    string
	AccessExpires  int64
	RefreshExpires int64
}

type Service

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

func NewService

func NewService(accessSecret, refreshSecret string) *Service

func (*Service) CreateToken

func (s *Service) CreateToken(userID int64) (*Details, error)

func (*Service) ValidateToken

func (s *Service) ValidateToken(r *http.Request) (*AccessDetails, error)

type UserClaims

type UserClaims struct {
	UserID      int64
	AccessUUID  string
	RefreshUUID string
	jwt.StandardClaims
}

func (UserClaims) Valid

func (u UserClaims) Valid() error

Jump to

Keyboard shortcuts

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