Documentation ¶
Index ¶
- Constants
- func NewAddressFromMD(md metadata.MD) (string, bool)
- func NewTraceIdFromMD(md metadata.MD) (string, bool)
- func ServerUnaryInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, ...) (interface{}, error)
- func UnaryClientInterceptor(ctx context.Context, method string, req, reply interface{}, ...) error
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 ¶
NewAddressFromMD 从grpc metadata获取操作者 ID
func NewTraceIdFromMD ¶
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.
Click to show internal directories.
Click to hide internal directories.