Documentation ¶
Index ¶
- func NewOpentracing(opts ...Option) middleware.Middleware
- type MDReaderWriter
- type Opentracing
- func (trace *Opentracing) StreamClient(ctx context.Context, desc *grpc.StreamDesc, cc *grpc.ClientConn, method string, ...) (cs grpc.ClientStream, err error)
- func (trace *Opentracing) StreamHandler(srv interface{}, stream grpc.ServerStream, info *grpc.StreamServerInfo, ...) (err error)
- func (trace *Opentracing) UnaryClient(ctx context.Context, method string, req, reply interface{}, ...) (err error)
- func (trace *Opentracing) UnaryHandler(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, ...) (resp interface{}, err error)
- type Option
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewOpentracing ¶
func NewOpentracing(opts ...Option) middleware.Middleware
NewOpentracing 创建链路追踪器
Types ¶
type MDReaderWriter ¶
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
type Opentracing ¶
type Opentracing struct {
Options *Options
}
Opentracing 链路追踪中间件
func (*Opentracing) StreamClient ¶
func (trace *Opentracing) StreamClient(ctx context.Context, desc *grpc.StreamDesc, cc *grpc.ClientConn, method string, streamer grpc.Streamer, opts ...grpc.CallOption) (cs grpc.ClientStream, err error)
StreamClient 流式服客户中间件 grpc.StreamClientInterceptor
func (*Opentracing) StreamHandler ¶
func (trace *Opentracing) StreamHandler(srv interface{}, stream grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) (err error)
StreamHandler 流式中间件
func (*Opentracing) UnaryClient ¶
func (trace *Opentracing) UnaryClient(ctx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) (err error)
UnaryClient 非流式客户端中间件 grpc.UnaryClientInterceptor
func (*Opentracing) UnaryHandler ¶
func (trace *Opentracing) UnaryHandler(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp interface{}, err error)
UnaryHandler 非流式中间件
type Option ¶
type Option func(*Options)
Option 实例值设置
func FilterOutFunc ¶
func FilterOutFunc(filterOutFunc middleware.FilterFunc) Option
FilterOutFunc 设置中间件忽略函数列表
type Options ¶
type Options struct { FilterOutFunc middleware.FilterFunc Logger *zap.SugaredLogger Tracer opentracing.Tracer }
Options 注册相关参数
Click to show internal directories.
Click to hide internal directories.