jwtg

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JwtGenerator

type JwtGenerator[T any] struct {
	ExpMinute int
	// contains filtered or unexported fields
}

func NewJwtGenrator

func NewJwtGenrator[T any](key []byte, container T) (jg *JwtGenerator[T], err error)

生成Jwt生成器

func (*JwtGenerator[T]) Sign added in v0.0.12

func (g *JwtGenerator[T]) Sign(u T) (token []byte, err error)

func (*JwtGenerator[T]) Verify added in v0.0.12

func (g *JwtGenerator[T]) Verify(b []byte) (token JwtToken[T], err error)

type JwtToken

type JwtToken[T any] struct {
	jwt.Payload
	Tag T `json:"t,omitempty"`
}

Jump to

Keyboard shortcuts

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