Documentation ¶
Index ¶
- Variables
- func DtmGrpcCall(s *dtmimp.TransBase, operation string) error
- func GetGrpcConn(grpcServer string, isRaw bool) (conn *grpc.ClientConn, rerr error)
- func GetMetaFromContext(ctx context.Context, name string) string
- func GrpcClientLog(ctx context.Context, method string, req, reply interface{}, ...) error
- func GrpcServerLog(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, ...) (interface{}, error)
- func LogDtmCtx(ctx context.Context)
- func Map2Kvs(m map[string]string) []string
- func MustGetDtmClient(grpcServer string) dtmgpb.DtmClient
- func MustGetGrpcConn(grpcServer string, isRaw bool) *grpc.ClientConn
- func MustGetRawDtmClient(grpcServer string) dtmgpb.DtmClient
- func MustProtoMarshal(msg proto.Message) []byte
- func Result2Error(res interface{}, err error) error
- func TransBaseFromGrpc(ctx context.Context) *dtmimp.TransBase
- func TransInfo2Ctx(gid, transType, branchID, op, dtm string) context.Context
Constants ¶
This section is empty.
Variables ¶
View Source
var ClientInterceptors = []grpc.UnaryClientInterceptor{}
Functions ¶
func DtmGrpcCall ¶
DtmGrpcCall make a convenient call to dtm
func GetGrpcConn ¶
func GetGrpcConn(grpcServer string, isRaw bool) (conn *grpc.ClientConn, rerr error)
GetGrpcConn 1
func GetMetaFromContext ¶ added in v1.8.2
GetMetaFromContext get header from context
func GrpcClientLog ¶
func GrpcClientLog(ctx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error
GrpcClientLog 打印grpc调用的日志
func GrpcServerLog ¶
func GrpcServerLog(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error)
GrpcServerLog 打印grpc服务端的日志
func MustGetDtmClient ¶
MustGetDtmClient 1
func MustGetGrpcConn ¶
func MustGetGrpcConn(grpcServer string, isRaw bool) *grpc.ClientConn
MustGetGrpcConn 1
func MustGetRawDtmClient ¶
MustGetRawDtmClient must get raw codec grpc conn
func MustProtoMarshal ¶
MustProtoMarshal must version of proto.Marshal
func Result2Error ¶
Result2Error 将通用的result转成grpc的error
func TransBaseFromGrpc ¶
TransBaseFromGrpc get trans base info from a context metadata
func TransInfo2Ctx ¶
TransInfo2Ctx add trans info to grpc context
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.