Documentation ¶
Index ¶
- Constants
- func GetToken(ctx context.Context) string
- func GetUserContextFromWithJwt[T any](ctx context.Context, secret string, uc *T) *errx.Error
- func LoggerInterceptor(ctx context.Context, req interface{}, _ *grpc.UnaryServerInfo, ...) (resp interface{}, err error)
- func RegisterAppTokens(appTokens map[string]string, key string, host string, password string)
- func UserContextInterceptor(ctx context.Context, req interface{}, _ *grpc.UnaryServerInfo, ...) (resp interface{}, err error)
Constants ¶
View Source
const (
AuthorizationKey = "authorization"
)
Variables ¶
This section is empty.
Functions ¶
func GetUserContextFromWithJwt ¶ added in v1.1.12
获取并验证jwt token
func LoggerInterceptor ¶
func LoggerInterceptor(ctx context.Context, req interface{}, _ *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp interface{}, err error)
func RegisterAppTokens ¶ added in v1.3.22
func UserContextInterceptor ¶
func UserContextInterceptor(ctx context.Context, req interface{}, _ *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp interface{}, err error)
token 不强制传递token
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.