dtmgimp

package
v1.8.2 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2021 License: BSD-3-Clause Imports: 15 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ClientInterceptors = []grpc.UnaryClientInterceptor{}

Functions

func DtmGrpcCall

func DtmGrpcCall(s *dtmimp.TransBase, operation string) error

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

func GetMetaFromContext(ctx context.Context, name string) string

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 LogDtmCtx

func LogDtmCtx(ctx context.Context)

LogDtmCtx logout dtm info in context metadata

func MustGetDtmClient

func MustGetDtmClient(grpcServer string) dtmgpb.DtmClient

MustGetDtmClient 1

func MustGetGrpcConn

func MustGetGrpcConn(grpcServer string, isRaw bool) *grpc.ClientConn

MustGetGrpcConn 1

func MustGetRawDtmClient

func MustGetRawDtmClient(grpcServer string) dtmgpb.DtmClient

MustGetRawDtmClient must get raw codec grpc conn

func MustProtoMarshal

func MustProtoMarshal(msg proto.Message) []byte

MustProtoMarshal must version of proto.Marshal

func Result2Error

func Result2Error(res interface{}, err error) error

Result2Error 将通用的result转成grpc的error

func TransBaseFromGrpc

func TransBaseFromGrpc(ctx context.Context) *dtmimp.TransBase

TransBaseFromGrpc get trans base info from a context metadata

func TransInfo2Ctx

func TransInfo2Ctx(gid, transType, branchID, op, dtm string) context.Context

TransInfo2Ctx add trans info to grpc context

Types

This section is empty.

Jump to

Keyboard shortcuts

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