ijwt

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package jwt provides an interface for handling JSON Web Tokens (JWT).

It includes the `IJwtService` interface for generating and decoding JWTs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IService

type IService interface {
	// Generate creates a JWT for the specified user.
	Generate(user *usermodel.User) (string, error)

	// Decode parses the provided JWT and returns the claims or an error.
	Decode(token string) (jwt.MapClaims, error)
}

IService defines methods for generating and decoding JSON Web Tokens (JWT).

Methods: - Generate(user *usermodel.User) (string, error): Generates a JWT for the given user and returns the token or an error. - Decode(token string) (jwt.MapClaims, error): Decodes the provided JWT and returns the claims or an error.

Jump to

Keyboard shortcuts

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