Documentation ¶
Index ¶
- func NewTracePropagator() propagation.TextMapPropagator
- func WithRecover() connect.HandlerOption
- func WithTracer() connect.Interceptor
- func WithValidator() connect.Interceptor
- type ResponseWriter
- type TracePropagator
- type UnaryHandlerFunc
- type UnaryInterceptor
- func (x *UnaryInterceptor) WrapStreamingClient(fn connect.StreamingClientFunc) connect.StreamingClientFunc
- func (x *UnaryInterceptor) WrapStreamingHandler(fn connect.StreamingHandlerFunc) connect.StreamingHandlerFunc
- func (x *UnaryInterceptor) WrapUnary(fn connect.UnaryFunc) connect.UnaryFunc
- func (x *UnaryInterceptor) WrapUnaryHandler(fn http.Handler) http.Handler
- type UnaryInterceptorFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewTracePropagator ¶
func NewTracePropagator() propagation.TextMapPropagator
NewTracePropagator creates a new propagator.
func WithRecover ¶
func WithRecover() connect.HandlerOption
WithRecover recovers the handler from any panic.
func WithTracer ¶
func WithTracer() connect.Interceptor
WithTracer set up the Open Telemetry Tracer.
func WithValidator ¶
func WithValidator() connect.Interceptor
WithValidator set up the request validator
Types ¶
type ResponseWriter ¶
type ResponseWriter struct { StatusCode int32 ContentLength int64 ResponseWriter http.ResponseWriter }
ResponseWriter repersents a response writer.
func (*ResponseWriter) GetContentLength ¶
func (r *ResponseWriter) GetContentLength() int64
GetContentLength returns the ContentLength.
func (*ResponseWriter) GetStatusCode ¶
func (r *ResponseWriter) GetStatusCode() int32
GetStatusCode returns the StatusCode.
func (*ResponseWriter) Header ¶
func (r *ResponseWriter) Header() http.Header
Header implements http.ResponseWriter
func (*ResponseWriter) Write ¶
func (r *ResponseWriter) Write(data []byte) (int, error)
Write implements http.ResponseWriter
func (*ResponseWriter) WriteHeader ¶
func (r *ResponseWriter) WriteHeader(code int)
WriteHeader implements http.ResponseWriter
type TracePropagator ¶
type TracePropagator struct{}
TracePropagator implements propagation.TracePropagator to propagate traces in HTTP headers for Google Cloud Platform and Stackdriver Trace.
func (TracePropagator) Extract ¶
func (f TracePropagator) Extract(ctx context.Context, carrier propagation.TextMapCarrier) context.Context
Extract returns the context from a given carrier.
func (TracePropagator) Fields ¶
func (f TracePropagator) Fields() []string
func (TracePropagator) Inject ¶
func (f TracePropagator) Inject(ctx context.Context, carrier propagation.TextMapCarrier)
Inject injects the span into a given carrier.
type UnaryHandlerFunc ¶
UnaryHandlerFunc represent the handler.
func WithUnaryHandler ¶
func WithUnaryHandler(collection []connect.Interceptor) UnaryHandlerFunc
WithUnaryHandler represents an unary handler
type UnaryInterceptor ¶
type UnaryInterceptor struct { UnaryHandler UnaryHandlerFunc UnaryInterceptor UnaryInterceptorFunc }
UnaryInterceptor represents an unary handler.
func (*UnaryInterceptor) WrapStreamingClient ¶
func (x *UnaryInterceptor) WrapStreamingClient(fn connect.StreamingClientFunc) connect.StreamingClientFunc
WrapStreamingClient implements connect.Interceptor
func (*UnaryInterceptor) WrapStreamingHandler ¶
func (x *UnaryInterceptor) WrapStreamingHandler(fn connect.StreamingHandlerFunc) connect.StreamingHandlerFunc
WrapStreamingHandler implements connect.Interceptor
func (*UnaryInterceptor) WrapUnary ¶
func (x *UnaryInterceptor) WrapUnary(fn connect.UnaryFunc) connect.UnaryFunc
WrapUnary implements connect.Interceptor
func (*UnaryInterceptor) WrapUnaryHandler ¶
func (x *UnaryInterceptor) WrapUnaryHandler(fn http.Handler) http.Handler
WrapUnaryHandler implements UnaryHandlerFunc.
type UnaryInterceptorFunc ¶
type UnaryInterceptorFunc = connect.UnaryInterceptorFunc
UnaryInterceptorFunc is a simple Interceptor implementation that only wraps unary RPCs. It has no effect on streaming RPCs.