trace

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// todo rename, oa那里也要一起改 X-Gateway-*
	OAOpeId   string = "X-OA-Ope-Id"
	OATraceId string = "X-OA-Trace-Id"
)

Variables

This section is empty.

Functions

func NewAddressFromMD

func NewAddressFromMD(md metadata.MD) (string, bool)

NewAddressFromMD 从grpc metadata获取操作者 ID

func NewTraceIdFromMD

func NewTraceIdFromMD(md metadata.MD) (string, bool)

NewTraceIdFromMD 从grpc metadata获取traceId

func ServerUnaryInterceptor

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

ServerUnaryInterceptor 默认令牌服务端一元拦截器

func UnaryClientInterceptor

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

UnaryClientInterceptor 默认令牌客户端一元拦截器

Types

This section is empty.

Jump to

Keyboard shortcuts

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