services

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2026 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package services contains business logic and service layer

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Claims

type Claims struct {
	jwt.RegisteredClaims
	Subject string `json:"sub"`
}

Claims represents the JWT claims

type JWTService

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

JWTService provides JWT token creation and verification

func NewJWTService

func NewJWTService(privateKey *rsa.PrivateKey, publicKey *rsa.PublicKey, issuer string, expiryTime time.Duration) *JWTService

NewJWTService creates a new JWT service with the given keys

func (*JWTService) GenerateToken

func (s *JWTService) GenerateToken(subject string) (string, error)

GenerateToken generates a new JWT token with the given subject

func (*JWTService) VerifyToken

func (s *JWTService) VerifyToken(tokenString string) (*Claims, error)

VerifyToken verifies a JWT token and returns the claims if valid

Jump to

Keyboard shortcuts

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