rpcx

package
v1.3.12 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AuthorizationKey = "authorization"
)

Variables

This section is empty.

Functions

func GetToken added in v1.1.12

func GetToken(ctx context.Context) string

获取token

func GetUserContextFromWithJwt added in v1.1.12

func GetUserContextFromWithJwt[T any](ctx context.Context, secret string, uc *T) *errx.CodeErr

获取并验证jwt token

func LoggerInterceptor

func LoggerInterceptor(ctx context.Context, req interface{}, _ *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp interface{}, err error)

func UserContextInterceptor

func UserContextInterceptor(ctx context.Context, req interface{}, _ *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp interface{}, err error)

token 不强制传递token

Types

type UserContextKey

type UserContextKey string

func NewUserContextKey

func NewUserContextKey() UserContextKey

Jump to

Keyboard shortcuts

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