jwtauth

package
v0.0.0-...-bdc8d50 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrSecretInvalid .
	ErrSecretInvalid = errors.New("the secret not be empty.")
	// ErrTokenExpired .
	ErrTokenExpired = errors.New("token has expired.")
	// ErrTokenInvalid .
	ErrTokenInvalid = errors.New("invalid token")
)

Functions

func Decode

func Decode(user *UserClaims) (string, error)

Decode .

func Expire

func Expire(d int) option

Expire .

func Set

func Set(secret string, os ...option)

Set .

Types

type UserClaims

type UserClaims struct {
	ID string
}

UserClaims .

func Encode

func Encode(tokenString string) (*UserClaims, error)

Encode .

Jump to

Keyboard shortcuts

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