xmiddleware

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2021 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Package xmiddleware @Description TODO @Author jiangyang @Created 2021/9/11 4:12 下午

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GrpcApm

func GrpcApm(apmURL, appName, appVersion, appEnv string) grpc.UnaryServerInterceptor

func GrpcAuth

func GrpcAuth(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error)

func GrpcLogger

func GrpcLogger(traceName string) grpc.UnaryServerInterceptor

func GrpcRecover

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

func GrpcValidate

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

func HttpErrorHandler

func HttpErrorHandler(ctx context.Context, mux *runtime.ServeMux, m runtime.Marshaler, w http.ResponseWriter, r *http.Request, err error)

func HttpLogger

func HttpLogger(traceName string) func(next http.Handler) http.Handler

func HttpUse

func HttpUse(h http.Handler, opt ...MiddlewareFunc) http.Handler

Types

type MiddlewareFunc

type MiddlewareFunc func(http.Handler) http.Handler

type ServiceAuthFuncOverride

type ServiceAuthFuncOverride interface {
	AuthFuncOverride(ctx context.Context, fullMethodName string) (context.Context, error)
}

Jump to

Keyboard shortcuts

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