middlewares

package
v4.19.5 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2023 License: AGPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const PatternHeader = "pattern"

Variables

View Source
var Etag string
View Source
var MetricsIgnoreFn = TracingIgnoreFn

Functions

func AllowCORS

func AllowCORS(h http.Handler) http.Handler

func DeletePatternHeader

func DeletePatternHeader(h http.Handler) http.Handler

func GetPatternHeader

func GetPatternHeader(w http.ResponseWriter) string

func HttpCache

func HttpCache(h http.Handler) http.Handler

func MetricsServerInterceptor

func MetricsServerInterceptor(ctx context.Context, req any, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp any, err error)

func MetricsStreamServerInterceptor

func MetricsStreamServerInterceptor(srv any, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error

func Recovery

func Recovery(h http.Handler) http.Handler

func ResponseMetrics

func ResponseMetrics(h http.Handler) http.Handler

func RouteLogger

func RouteLogger(h http.Handler) http.Handler

func SetPatternHeader

func SetPatternHeader(w http.ResponseWriter, val string)

func TraceUnaryClientInterceptor

func TraceUnaryClientInterceptor(ctx context.Context, method string, req, reply any, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error

func TraceUnaryServerInterceptor

func TraceUnaryServerInterceptor(ctx context.Context, req any, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp any, err error)

func TracingIgnoreFn

func TracingIgnoreFn(fullMethodName string) bool

func TracingWrapper

func TracingWrapper(h http.Handler) http.Handler

TracingWrapper [W3C Tracing Headers](https://www.w3.org/TR/trace-context/)

Types

type CustomResponseWriter

type CustomResponseWriter struct {
	http.ResponseWriter
	// contains filtered or unexported fields
}

func (*CustomResponseWriter) Write

func (c *CustomResponseWriter) Write(bytes []byte) (int, error)

type GatewayCarrier

type GatewayCarrier metadata.MD

func (GatewayCarrier) Get

func (hc GatewayCarrier) Get(key string) string

func (GatewayCarrier) Keys

func (hc GatewayCarrier) Keys() []string

func (GatewayCarrier) Set

func (hc GatewayCarrier) Set(key string, value string)

type HttpCacheBody

type HttpCacheBody struct {
	Etag string
}

Jump to

Keyboard shortcuts

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