middleware

package
v0.0.0-...-47b6ad5 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GRPCClientInterceptor

func GRPCClientInterceptor(ctx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) (err error)

GRPCClientInterceptor 拦截器

func GRPCServerInterceptor

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

GRPCServerInterceptor 拦截器

Types

type TextMapReader

type TextMapReader struct {
	metadata.MD
}

TextMapReader read

func (TextMapReader) ForeachKey

func (t TextMapReader) ForeachKey(handler func(key, val string) error) error

ForeachKey 读取metadata中的span信息

type TextMapWriter

type TextMapWriter struct {
	metadata.MD
}

TextMapWriter carrier

func (TextMapWriter) Set

func (t TextMapWriter) Set(key, val string)

Set 重写TextMapWriter的Set方法,我们需要将carrier中的数据写入到metadata中,这样grpc才会携带。

Jump to

Keyboard shortcuts

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