token

package
v0.0.0-...-c5655d5 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 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 TokenService

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

func NewTokenService

func NewTokenService(tokenTTL int, signingKey string) *TokenService

func (*TokenService) GenerateToken

func (s *TokenService) GenerateToken(ctx context.Context, id, role int) (string, error)

func (*TokenService) ParseToken

func (s *TokenService) ParseToken(ctx context.Context, tokenString string) (int, int, error)

type UserJWTClaims

type UserJWTClaims struct {
	jwt.StandardClaims
	UserId   int `json:"user_id"`
	UserRole int `json:"user_role"`
}

Jump to

Keyboard shortcuts

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