jwt

package
v1.9.2 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const BizIDName = "biz_id"

Variables

This section is empty.

Functions

func ContextWithJWT

func ContextWithJWT(ctx context.Context, key string) context.Context

Types

type InterceptorBuilder

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

func NewJwtAuth

func NewJwtAuth(key string) *InterceptorBuilder

func (*InterceptorBuilder) Decode

func (b *InterceptorBuilder) Decode(tokenString string) (jwt.MapClaims, error)

func (*InterceptorBuilder) Encode

func (b *InterceptorBuilder) Encode(customClaims jwt.MapClaims) (string, error)

Encode 生成 JWT Token,支持自定义声明和自动添加标准声明

func (*InterceptorBuilder) JwtAuthInterceptor

func (b *InterceptorBuilder) JwtAuthInterceptor() grpc.UnaryServerInterceptor

Jump to

Keyboard shortcuts

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