services

package
v0.0.0-...-5e1457b Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JsonWebTokenService

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

func NewJsonWebTokenService

func NewJsonWebTokenService() (*JsonWebTokenService, error)

func (*JsonWebTokenService) GenerateTokenWithUserClaims

func (jwts *JsonWebTokenService) GenerateTokenWithUserClaims(usr models.User) (string, error)

func (*JsonWebTokenService) ValidateAndParseToken

func (jwts *JsonWebTokenService) ValidateAndParseToken(rawToken string) (*TokenClaims, error)

type TokenClaims

type TokenClaims struct {
	IssuedAt  time.Time `json:"issued_at"`
	ExpiresAt time.Time `json:"expires_at"`
	UserId    uint      `json:"user_id"`
	IsAdmin   bool      `json:"is_admin"`
}

Jump to

Keyboard shortcuts

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