middleware

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// TracingComponentTag tags
	TracingComponentTag = opentracing.Tag{Key: string(ext.Component), Value: "gRPC"}
)

Functions

func LogInterceptor

func LogInterceptor(log zerolog.Logger) grpc.UnaryServerInterceptor

LogInterceptor rpc 接口日志中间件,用来记录每个 RPC 调用的 请求参数和返回值

func OpenTracingClientInterceptor

func OpenTracingClientInterceptor(tracer opentracing.Tracer) grpc.UnaryClientInterceptor

OpenTracingClientInterceptor rewrite client's interceptor with open tracing

Types

type MDReaderWriter

type MDReaderWriter struct {
	metadata.MD
}

MDReaderWriter metadata Reader and Writer

func (MDReaderWriter) ForeachKey

func (c MDReaderWriter) ForeachKey(handler func(key, val string) error) error

ForeachKey range all keys to call handler

func (MDReaderWriter) Set

func (c MDReaderWriter) Set(key, val string)

Set implements Set() of opentracing.TextMapWriter

Jump to

Keyboard shortcuts

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