middleware

package
v0.3.6-alpha Latest Latest
Warning

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

Go to latest
Published: May 5, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CustomMatcher

func CustomMatcher(key string) (string, bool)

CustomMatcher is a callback function for gRPC-Gateway runtime.WithIncomingHeaderMatcher

func ErrorHandler

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

ErrorHandler is a callback function for gRPC-Gateway runtime.WithErrorHandler

func GetRequestSingleHeader

func GetRequestSingleHeader(ctx context.Context, header string) string

GetRequestSingleHeader get a request header, the header has to be single-value HTTP header

func HttpResponseModifier

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

HTTPResponseModifier is a callback function for gRPC-Gateway runtime.WithForwardResponseOption

func RecoveryInterceptorOpt

func RecoveryInterceptorOpt() grpc_recovery.Option

RecoveryInterceptor - panic handler

func StreamAppendMetadataInterceptor

func StreamAppendMetadataInterceptor(srv interface{}, stream grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error

CustomInterceptor - append metadatas for stream

func UnaryAppendMetadataInterceptor

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

CustomInterceptor - append metadatas for unary

Types

This section is empty.

Jump to

Keyboard shortcuts

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