auth

package
v0.0.29 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2025 License: MIT Imports: 5 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JWTInterface

type JWTInterface[C jwt.Claims] interface {
	// A method generate JWT Token String and it will return error if there is error while generating JWT Token String
	Generate(ctx context.Context) (string, error)

	// For validate JWT Token String
	Validate(ctx context.Context, tokenString string) (*jwt.Token, error)

	// Extract a claims object from JWT Token String
	ExtractClaims(ctx context.Context, jwtToken *jwt.Token) (C, error)

	// Use this method if you want to modify signing method. Default signing method is `jwt.SigningMethodHS256`
	WithSigningMethod(signingMethod jwt.SigningMethod) JWTInterface[C]
}

func InitJWT

func InitJWT[C jwt.Claims](secretKey []byte, claims C) JWTInterface[C]

Jump to

Keyboard shortcuts

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