grpc_gateway

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2023 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const HttpMethodKey = "ffx-http-method"
View Source
const HttpRequestUriKey = "ffx-http-request-uri"
View Source
const XHeaderPrefix = "X-"

Variables

This section is empty.

Functions

func CustomHTTPErrorHandler

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

CustomHTTPErrorHandler is the default error handler. 参考 https://github.com/grpc-ecosystem/grpc-gateway/blob/main/runtime/errors.go CustomHTTPErrorHandler

func GetGlobalMiddlewareDialOptions

func GetGlobalMiddlewareDialOptions() []grpc.DialOption

GetGlobalMiddlewareDialOptions 获取grpc client 全局中间件选项

func GetGlobalServeMuxOptions

func GetGlobalServeMuxOptions() []runtime.ServeMuxOption

GetGlobalServeMuxOptions 获取全局mux选项

func GetGrpcGatewayMux

func GetGrpcGatewayMux(ctx context.Context) (ggMux *runtime.ServeMux, err error)

func HttpResponseModifier

func HttpResponseModifier(ctx context.Context, w http.ResponseWriter, p proto.Message) error

HttpResponseModifier http响应重写

func IncomingHeaderMatcher

func IncomingHeaderMatcher(key string) (string, bool)

func OutgoingHeaderMatcher

func OutgoingHeaderMatcher(key string) (string, bool)

Types

This section is empty.

Jump to

Keyboard shortcuts

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