Documentation ¶
Index ¶
- Variables
- func DtmGrpcCall(s *dtmimp.TransBase, operation string) error
- func GetDtmMetaFromContext(ctx context.Context, name string) string
- func GetDtmRequest(s *dtmimp.TransBase) *dtmgpb.DtmRequest
- 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 InvokeBranch(t *dtmimp.TransBase, isRaw bool, msg proto.Message, url string, ...) 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 MustProtoMarshal(msg proto.Message) []byte
- func MustProtoUnmarshal(data []byte, msg proto.Message)
- func RequestTimeoutFromContext(ctx context.Context) int64
- func RequestTimeoutNewContext(ctx context.Context, requestTimeout int64) context.Context
- func TransBaseFromGrpc(ctx context.Context) *dtmimp.TransBase
- func TransInfo2Ctx(ctx context.Context, gid, transType, branchID, op, dtm string) context.Context
Constants ¶
This section is empty.
Variables ¶
var ClientInterceptors = []grpc.UnaryClientInterceptor{}
ClientInterceptors declares grpc.UnaryClientInterceptors slice
Functions ¶
func DtmGrpcCall ¶
DtmGrpcCall make a convenient call to dtm
func GetDtmMetaFromContext ¶ added in v1.13.0
GetDtmMetaFromContext get dtm header from context
func GetDtmRequest ¶ added in v1.15.0
func GetDtmRequest(s *dtmimp.TransBase) *dtmgpb.DtmRequest
GetDtmRequest return a DtmRequest from TransBase
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 middleware to print client-side grpc log
func GrpcServerLog ¶
func GrpcServerLog(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error)
GrpcServerLog middleware to print server-side grpc log
func InvokeBranch ¶ added in v1.11.1
func InvokeBranch(t *dtmimp.TransBase, isRaw bool, msg proto.Message, url string, reply interface{}, branchID string, op string) error
InvokeBranch invoke a url for trans
func MustGetDtmClient ¶
MustGetDtmClient 1
func MustGetGrpcConn ¶
func MustGetGrpcConn(grpcServer string, isRaw bool) *grpc.ClientConn
MustGetGrpcConn 1
func MustProtoMarshal ¶
MustProtoMarshal must version of proto.Marshal
func MustProtoUnmarshal ¶ added in v1.15.0
MustProtoUnmarshal must version of proto.Unmarshal
func RequestTimeoutFromContext ¶ added in v1.13.0
RequestTimeoutFromContext returns requestTime of transOption option
func RequestTimeoutNewContext ¶ added in v1.13.0
RequestTimeoutNewContext sets requestTimeout of transOption option to context
func TransBaseFromGrpc ¶
TransBaseFromGrpc get trans base info from a context metadata
Types ¶
This section is empty.