more code from dtmcli
This commit is contained in:
parent
4e9a24ebaa
commit
74813607a3
@ -9,6 +9,7 @@ package dtmpb
|
|||||||
import (
|
import (
|
||||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||||
|
emptypb "google.golang.org/protobuf/types/known/emptypb"
|
||||||
reflect "reflect"
|
reflect "reflect"
|
||||||
sync "sync"
|
sync "sync"
|
||||||
)
|
)
|
||||||
@ -367,63 +368,62 @@ var File_dtmpb_dtmpb_proto protoreflect.FileDescriptor
|
|||||||
|
|
||||||
var file_dtmpb_dtmpb_proto_rawDesc = []byte{
|
var file_dtmpb_dtmpb_proto_rawDesc = []byte{
|
||||||
0x0a, 0x11, 0x64, 0x74, 0x6d, 0x70, 0x62, 0x2f, 0x64, 0x74, 0x6d, 0x70, 0x62, 0x2e, 0x70, 0x72,
|
0x0a, 0x11, 0x64, 0x74, 0x6d, 0x70, 0x62, 0x2f, 0x64, 0x74, 0x6d, 0x70, 0x62, 0x2e, 0x70, 0x72,
|
||||||
0x6f, 0x74, 0x6f, 0x12, 0x06, 0x64, 0x74, 0x6d, 0x63, 0x6c, 0x69, 0x22, 0x8c, 0x01, 0x0a, 0x0c,
|
0x6f, 0x74, 0x6f, 0x12, 0x05, 0x64, 0x74, 0x6d, 0x70, 0x62, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67,
|
||||||
0x44, 0x74, 0x6d, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x10, 0x0a, 0x03,
|
0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74,
|
||||||
0x47, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x47, 0x69, 0x64, 0x12, 0x1c,
|
0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x8c, 0x01, 0x0a, 0x0c, 0x44, 0x74, 0x6d, 0x54,
|
||||||
0x0a, 0x09, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x54, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,
|
0x72, 0x61, 0x6e, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x10, 0x0a, 0x03, 0x47, 0x69, 0x64, 0x18,
|
||||||
0x09, 0x52, 0x09, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x08,
|
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x47, 0x69, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x54, 0x72,
|
||||||
0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x49, 0x44, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08,
|
0x61, 0x6e, 0x73, 0x54, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x54,
|
||||||
0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x49, 0x44, 0x12, 0x1e, 0x0a, 0x0a, 0x42, 0x72, 0x61, 0x6e,
|
0x72, 0x61, 0x6e, 0x73, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x42, 0x72, 0x61, 0x6e,
|
||||||
0x63, 0x68, 0x54, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x42, 0x72,
|
0x63, 0x68, 0x49, 0x44, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x42, 0x72, 0x61, 0x6e,
|
||||||
0x61, 0x6e, 0x63, 0x68, 0x54, 0x79, 0x70, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x44, 0x74, 0x6d, 0x18,
|
0x63, 0x68, 0x49, 0x44, 0x12, 0x1e, 0x0a, 0x0a, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x54, 0x79,
|
||||||
0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x44, 0x74, 0x6d, 0x22, 0x85, 0x02, 0x0a, 0x0a, 0x44,
|
0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68,
|
||||||
0x74, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x47, 0x69, 0x64,
|
0x54, 0x79, 0x70, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x44, 0x74, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28,
|
||||||
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x47, 0x69, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x54,
|
0x09, 0x52, 0x03, 0x44, 0x74, 0x6d, 0x22, 0x84, 0x02, 0x0a, 0x0a, 0x44, 0x74, 0x6d, 0x52, 0x65,
|
||||||
0x72, 0x61, 0x6e, 0x73, 0x54, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09,
|
0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x47, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01,
|
||||||
0x54, 0x72, 0x61, 0x6e, 0x73, 0x54, 0x79, 0x70, 0x65, 0x12, 0x24, 0x0a, 0x0d, 0x51, 0x75, 0x65,
|
0x28, 0x09, 0x52, 0x03, 0x47, 0x69, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x54, 0x72, 0x61, 0x6e, 0x73,
|
||||||
0x72, 0x79, 0x50, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09,
|
0x54, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x54, 0x72, 0x61, 0x6e,
|
||||||
0x52, 0x0d, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x64, 0x12,
|
0x73, 0x54, 0x79, 0x70, 0x65, 0x12, 0x24, 0x0a, 0x0d, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72,
|
||||||
0x1e, 0x0a, 0x0a, 0x57, 0x61, 0x69, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x04, 0x20,
|
0x65, 0x70, 0x61, 0x72, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x51, 0x75,
|
||||||
0x01, 0x28, 0x08, 0x52, 0x0a, 0x57, 0x61, 0x69, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12,
|
0x65, 0x72, 0x79, 0x50, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x57,
|
||||||
0x33, 0x0a, 0x05, 0x45, 0x78, 0x74, 0x72, 0x61, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d,
|
0x61, 0x69, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52,
|
||||||
0x2e, 0x64, 0x74, 0x6d, 0x63, 0x6c, 0x69, 0x2e, 0x44, 0x74, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65,
|
0x0a, 0x57, 0x61, 0x69, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x32, 0x0a, 0x05, 0x45,
|
||||||
0x73, 0x74, 0x2e, 0x45, 0x78, 0x74, 0x72, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x05, 0x45,
|
0x78, 0x74, 0x72, 0x61, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x64, 0x74, 0x6d,
|
||||||
0x78, 0x74, 0x72, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x44, 0x61, 0x74, 0x61, 0x18, 0x06, 0x20, 0x01,
|
0x70, 0x62, 0x2e, 0x44, 0x74, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x45, 0x78,
|
||||||
0x28, 0x09, 0x52, 0x04, 0x44, 0x61, 0x74, 0x61, 0x1a, 0x38, 0x0a, 0x0a, 0x45, 0x78, 0x74, 0x72,
|
0x74, 0x72, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x05, 0x45, 0x78, 0x74, 0x72, 0x61, 0x12,
|
||||||
0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20,
|
0x12, 0x0a, 0x04, 0x44, 0x61, 0x74, 0x61, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x44,
|
||||||
0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75,
|
0x61, 0x74, 0x61, 0x1a, 0x38, 0x0a, 0x0a, 0x45, 0x78, 0x74, 0x72, 0x61, 0x45, 0x6e, 0x74, 0x72,
|
||||||
0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02,
|
0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03,
|
||||||
0x38, 0x01, 0x22, 0x48, 0x0a, 0x08, 0x44, 0x74, 0x6d, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x1c,
|
0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01,
|
||||||
0x0a, 0x09, 0x44, 0x74, 0x6d, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28,
|
0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x48, 0x0a,
|
||||||
0x09, 0x52, 0x09, 0x44, 0x74, 0x6d, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x1e, 0x0a, 0x0a,
|
0x08, 0x44, 0x74, 0x6d, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x1c, 0x0a, 0x09, 0x44, 0x74, 0x6d,
|
||||||
0x44, 0x74, 0x6d, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
|
0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x44, 0x74,
|
||||||
0x52, 0x0a, 0x44, 0x74, 0x6d, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0xc1, 0x01, 0x0a,
|
0x6d, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x44, 0x74, 0x6d, 0x4d, 0x65,
|
||||||
0x0b, 0x42, 0x75, 0x73, 0x69, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x28, 0x0a, 0x04,
|
0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x44, 0x74, 0x6d,
|
||||||
0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x64, 0x74, 0x6d,
|
0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0xbf, 0x01, 0x0a, 0x0b, 0x42, 0x75, 0x73, 0x69,
|
||||||
0x63, 0x6c, 0x69, 0x2e, 0x44, 0x74, 0x6d, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x49, 0x6e, 0x66, 0x6f,
|
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x27, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18,
|
||||||
0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x12, 0x34, 0x0a, 0x05, 0x45, 0x78, 0x74, 0x72, 0x61, 0x18,
|
0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x64, 0x74, 0x6d, 0x70, 0x62, 0x2e, 0x44, 0x74,
|
||||||
0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x64, 0x74, 0x6d, 0x63, 0x6c, 0x69, 0x2e, 0x42,
|
0x6d, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f,
|
||||||
0x75, 0x73, 0x69, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x45, 0x78, 0x74, 0x72, 0x61,
|
0x12, 0x33, 0x0a, 0x05, 0x45, 0x78, 0x74, 0x72, 0x61, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32,
|
||||||
0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x05, 0x45, 0x78, 0x74, 0x72, 0x61, 0x12, 0x18, 0x0a, 0x07,
|
0x1d, 0x2e, 0x64, 0x74, 0x6d, 0x70, 0x62, 0x2e, 0x42, 0x75, 0x73, 0x69, 0x52, 0x65, 0x71, 0x75,
|
||||||
0x41, 0x70, 0x70, 0x44, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x41,
|
0x65, 0x73, 0x74, 0x2e, 0x45, 0x78, 0x74, 0x72, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x05,
|
||||||
0x70, 0x70, 0x44, 0x61, 0x74, 0x61, 0x1a, 0x38, 0x0a, 0x0a, 0x45, 0x78, 0x74, 0x72, 0x61, 0x45,
|
0x45, 0x78, 0x74, 0x72, 0x61, 0x12, 0x18, 0x0a, 0x07, 0x41, 0x70, 0x70, 0x44, 0x61, 0x74, 0x61,
|
||||||
0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28,
|
0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x41, 0x70, 0x70, 0x44, 0x61, 0x74, 0x61, 0x1a,
|
||||||
0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18,
|
0x38, 0x0a, 0x0a, 0x45, 0x78, 0x74, 0x72, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a,
|
||||||
0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01,
|
0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12,
|
||||||
0x22, 0x49, 0x0a, 0x09, 0x42, 0x75, 0x73, 0x69, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x1c, 0x0a,
|
0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05,
|
||||||
0x09, 0x44, 0x74, 0x6d, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
|
0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x49, 0x0a, 0x09, 0x42, 0x75, 0x73,
|
||||||
0x52, 0x09, 0x44, 0x74, 0x6d, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x44,
|
0x69, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x1c, 0x0a, 0x09, 0x44, 0x74, 0x6d, 0x52, 0x65, 0x73,
|
||||||
0x74, 0x6d, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
|
0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x44, 0x74, 0x6d, 0x52, 0x65,
|
||||||
0x0a, 0x44, 0x74, 0x6d, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x32, 0x67, 0x0a, 0x03, 0x44,
|
0x73, 0x75, 0x6c, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x44, 0x74, 0x6d, 0x4d, 0x65, 0x73, 0x73, 0x61,
|
||||||
0x74, 0x6d, 0x12, 0x2e, 0x0a, 0x04, 0x43, 0x61, 0x6c, 0x6c, 0x12, 0x12, 0x2e, 0x64, 0x74, 0x6d,
|
0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x44, 0x74, 0x6d, 0x4d, 0x65, 0x73,
|
||||||
0x63, 0x6c, 0x69, 0x2e, 0x44, 0x74, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x10,
|
0x73, 0x61, 0x67, 0x65, 0x32, 0x3c, 0x0a, 0x03, 0x44, 0x74, 0x6d, 0x12, 0x35, 0x0a, 0x06, 0x53,
|
||||||
0x2e, 0x64, 0x74, 0x6d, 0x63, 0x6c, 0x69, 0x2e, 0x44, 0x74, 0x6d, 0x52, 0x65, 0x70, 0x6c, 0x79,
|
0x75, 0x62, 0x6d, 0x69, 0x74, 0x12, 0x11, 0x2e, 0x64, 0x74, 0x6d, 0x70, 0x62, 0x2e, 0x44, 0x74,
|
||||||
0x22, 0x00, 0x12, 0x30, 0x0a, 0x06, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x12, 0x12, 0x2e, 0x64,
|
0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
|
||||||
0x74, 0x6d, 0x63, 0x6c, 0x69, 0x2e, 0x44, 0x74, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
|
0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79,
|
||||||
0x1a, 0x10, 0x2e, 0x64, 0x74, 0x6d, 0x63, 0x6c, 0x69, 0x2e, 0x44, 0x74, 0x6d, 0x52, 0x65, 0x70,
|
0x22, 0x00, 0x42, 0x1b, 0x5a, 0x19, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d,
|
||||||
0x6c, 0x79, 0x22, 0x00, 0x42, 0x1b, 0x5a, 0x19, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63,
|
0x2f, 0x79, 0x65, 0x64, 0x66, 0x2f, 0x64, 0x74, 0x6d, 0x2f, 0x64, 0x74, 0x6d, 0x70, 0x62, 0x62,
|
||||||
0x6f, 0x6d, 0x2f, 0x79, 0x65, 0x64, 0x66, 0x2f, 0x64, 0x74, 0x6d, 0x2f, 0x64, 0x74, 0x6d, 0x70,
|
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||||
0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -440,24 +440,23 @@ func file_dtmpb_dtmpb_proto_rawDescGZIP() []byte {
|
|||||||
|
|
||||||
var file_dtmpb_dtmpb_proto_msgTypes = make([]protoimpl.MessageInfo, 7)
|
var file_dtmpb_dtmpb_proto_msgTypes = make([]protoimpl.MessageInfo, 7)
|
||||||
var file_dtmpb_dtmpb_proto_goTypes = []interface{}{
|
var file_dtmpb_dtmpb_proto_goTypes = []interface{}{
|
||||||
(*DtmTransInfo)(nil), // 0: dtmcli.DtmTransInfo
|
(*DtmTransInfo)(nil), // 0: dtmpb.DtmTransInfo
|
||||||
(*DtmRequest)(nil), // 1: dtmcli.DtmRequest
|
(*DtmRequest)(nil), // 1: dtmpb.DtmRequest
|
||||||
(*DtmReply)(nil), // 2: dtmcli.DtmReply
|
(*DtmReply)(nil), // 2: dtmpb.DtmReply
|
||||||
(*BusiRequest)(nil), // 3: dtmcli.BusiRequest
|
(*BusiRequest)(nil), // 3: dtmpb.BusiRequest
|
||||||
(*BusiReply)(nil), // 4: dtmcli.BusiReply
|
(*BusiReply)(nil), // 4: dtmpb.BusiReply
|
||||||
nil, // 5: dtmcli.DtmRequest.ExtraEntry
|
nil, // 5: dtmpb.DtmRequest.ExtraEntry
|
||||||
nil, // 6: dtmcli.BusiRequest.ExtraEntry
|
nil, // 6: dtmpb.BusiRequest.ExtraEntry
|
||||||
|
(*emptypb.Empty)(nil), // 7: google.protobuf.Empty
|
||||||
}
|
}
|
||||||
var file_dtmpb_dtmpb_proto_depIdxs = []int32{
|
var file_dtmpb_dtmpb_proto_depIdxs = []int32{
|
||||||
5, // 0: dtmcli.DtmRequest.Extra:type_name -> dtmcli.DtmRequest.ExtraEntry
|
5, // 0: dtmpb.DtmRequest.Extra:type_name -> dtmpb.DtmRequest.ExtraEntry
|
||||||
0, // 1: dtmcli.BusiRequest.info:type_name -> dtmcli.DtmTransInfo
|
0, // 1: dtmpb.BusiRequest.info:type_name -> dtmpb.DtmTransInfo
|
||||||
6, // 2: dtmcli.BusiRequest.Extra:type_name -> dtmcli.BusiRequest.ExtraEntry
|
6, // 2: dtmpb.BusiRequest.Extra:type_name -> dtmpb.BusiRequest.ExtraEntry
|
||||||
1, // 3: dtmcli.Dtm.Call:input_type -> dtmcli.DtmRequest
|
1, // 3: dtmpb.Dtm.Submit:input_type -> dtmpb.DtmRequest
|
||||||
1, // 4: dtmcli.Dtm.Submit:input_type -> dtmcli.DtmRequest
|
7, // 4: dtmpb.Dtm.Submit:output_type -> google.protobuf.Empty
|
||||||
2, // 5: dtmcli.Dtm.Call:output_type -> dtmcli.DtmReply
|
4, // [4:5] is the sub-list for method output_type
|
||||||
2, // 6: dtmcli.Dtm.Submit:output_type -> dtmcli.DtmReply
|
3, // [3:4] is the sub-list for method input_type
|
||||||
5, // [5:7] is the sub-list for method output_type
|
|
||||||
3, // [3:5] is the sub-list for method input_type
|
|
||||||
3, // [3:3] is the sub-list for extension type_name
|
3, // [3:3] is the sub-list for extension type_name
|
||||||
3, // [3:3] is the sub-list for extension extendee
|
3, // [3:3] is the sub-list for extension extendee
|
||||||
0, // [0:3] is the sub-list for field type_name
|
0, // [0:3] is the sub-list for field type_name
|
||||||
|
|||||||
@ -1,13 +1,13 @@
|
|||||||
syntax = "proto3";
|
syntax = "proto3";
|
||||||
|
|
||||||
option go_package = "github.com/yedf/dtm/dtmpb";
|
option go_package = "github.com/yedf/dtm/dtmpb";
|
||||||
|
import "google/protobuf/empty.proto";
|
||||||
|
|
||||||
package dtmcli;
|
package dtmpb;
|
||||||
|
|
||||||
// The dtm service definition.
|
// The dtm service definition.
|
||||||
service Dtm {
|
service Dtm {
|
||||||
rpc Call(DtmRequest) returns (DtmReply) {}
|
rpc Submit(DtmRequest) returns (google.protobuf.Empty) {}
|
||||||
rpc Submit(DtmRequest) returns (DtmReply) {}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -37,7 +37,7 @@ message DtmReply {
|
|||||||
|
|
||||||
// The request message containing the user's name.
|
// The request message containing the user's name.
|
||||||
message BusiRequest {
|
message BusiRequest {
|
||||||
dtmcli.DtmTransInfo info = 1;
|
DtmTransInfo info = 1;
|
||||||
map<string, string> Extra = 2;
|
map<string, string> Extra = 2;
|
||||||
bytes AppData = 3;
|
bytes AppData = 3;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,6 +7,7 @@ import (
|
|||||||
grpc "google.golang.org/grpc"
|
grpc "google.golang.org/grpc"
|
||||||
codes "google.golang.org/grpc/codes"
|
codes "google.golang.org/grpc/codes"
|
||||||
status "google.golang.org/grpc/status"
|
status "google.golang.org/grpc/status"
|
||||||
|
emptypb "google.golang.org/protobuf/types/known/emptypb"
|
||||||
)
|
)
|
||||||
|
|
||||||
// This is a compile-time assertion to ensure that this generated file
|
// This is a compile-time assertion to ensure that this generated file
|
||||||
@ -18,8 +19,7 @@ const _ = grpc.SupportPackageIsVersion7
|
|||||||
//
|
//
|
||||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||||
type DtmClient interface {
|
type DtmClient interface {
|
||||||
Call(ctx context.Context, in *DtmRequest, opts ...grpc.CallOption) (*DtmReply, error)
|
Submit(ctx context.Context, in *DtmRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
||||||
Submit(ctx context.Context, in *DtmRequest, opts ...grpc.CallOption) (*DtmReply, error)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type dtmClient struct {
|
type dtmClient struct {
|
||||||
@ -30,18 +30,9 @@ func NewDtmClient(cc grpc.ClientConnInterface) DtmClient {
|
|||||||
return &dtmClient{cc}
|
return &dtmClient{cc}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *dtmClient) Call(ctx context.Context, in *DtmRequest, opts ...grpc.CallOption) (*DtmReply, error) {
|
func (c *dtmClient) Submit(ctx context.Context, in *DtmRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
||||||
out := new(DtmReply)
|
out := new(emptypb.Empty)
|
||||||
err := c.cc.Invoke(ctx, "/dtmcli.Dtm/Call", in, out, opts...)
|
err := c.cc.Invoke(ctx, "/dtmpb.Dtm/Submit", in, out, opts...)
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return out, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *dtmClient) Submit(ctx context.Context, in *DtmRequest, opts ...grpc.CallOption) (*DtmReply, error) {
|
|
||||||
out := new(DtmReply)
|
|
||||||
err := c.cc.Invoke(ctx, "/dtmcli.Dtm/Submit", in, out, opts...)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -52,8 +43,7 @@ func (c *dtmClient) Submit(ctx context.Context, in *DtmRequest, opts ...grpc.Cal
|
|||||||
// All implementations must embed UnimplementedDtmServer
|
// All implementations must embed UnimplementedDtmServer
|
||||||
// for forward compatibility
|
// for forward compatibility
|
||||||
type DtmServer interface {
|
type DtmServer interface {
|
||||||
Call(context.Context, *DtmRequest) (*DtmReply, error)
|
Submit(context.Context, *DtmRequest) (*emptypb.Empty, error)
|
||||||
Submit(context.Context, *DtmRequest) (*DtmReply, error)
|
|
||||||
mustEmbedUnimplementedDtmServer()
|
mustEmbedUnimplementedDtmServer()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -61,10 +51,7 @@ type DtmServer interface {
|
|||||||
type UnimplementedDtmServer struct {
|
type UnimplementedDtmServer struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (UnimplementedDtmServer) Call(context.Context, *DtmRequest) (*DtmReply, error) {
|
func (UnimplementedDtmServer) Submit(context.Context, *DtmRequest) (*emptypb.Empty, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method Call not implemented")
|
|
||||||
}
|
|
||||||
func (UnimplementedDtmServer) Submit(context.Context, *DtmRequest) (*DtmReply, error) {
|
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method Submit not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method Submit not implemented")
|
||||||
}
|
}
|
||||||
func (UnimplementedDtmServer) mustEmbedUnimplementedDtmServer() {}
|
func (UnimplementedDtmServer) mustEmbedUnimplementedDtmServer() {}
|
||||||
@ -80,24 +67,6 @@ func RegisterDtmServer(s grpc.ServiceRegistrar, srv DtmServer) {
|
|||||||
s.RegisterService(&Dtm_ServiceDesc, srv)
|
s.RegisterService(&Dtm_ServiceDesc, srv)
|
||||||
}
|
}
|
||||||
|
|
||||||
func _Dtm_Call_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
||||||
in := new(DtmRequest)
|
|
||||||
if err := dec(in); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
if interceptor == nil {
|
|
||||||
return srv.(DtmServer).Call(ctx, in)
|
|
||||||
}
|
|
||||||
info := &grpc.UnaryServerInfo{
|
|
||||||
Server: srv,
|
|
||||||
FullMethod: "/dtmcli.Dtm/Call",
|
|
||||||
}
|
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
||||||
return srv.(DtmServer).Call(ctx, req.(*DtmRequest))
|
|
||||||
}
|
|
||||||
return interceptor(ctx, in, info, handler)
|
|
||||||
}
|
|
||||||
|
|
||||||
func _Dtm_Submit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
func _Dtm_Submit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
in := new(DtmRequest)
|
in := new(DtmRequest)
|
||||||
if err := dec(in); err != nil {
|
if err := dec(in); err != nil {
|
||||||
@ -108,7 +77,7 @@ func _Dtm_Submit_Handler(srv interface{}, ctx context.Context, dec func(interfac
|
|||||||
}
|
}
|
||||||
info := &grpc.UnaryServerInfo{
|
info := &grpc.UnaryServerInfo{
|
||||||
Server: srv,
|
Server: srv,
|
||||||
FullMethod: "/dtmcli.Dtm/Submit",
|
FullMethod: "/dtmpb.Dtm/Submit",
|
||||||
}
|
}
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
return srv.(DtmServer).Submit(ctx, req.(*DtmRequest))
|
return srv.(DtmServer).Submit(ctx, req.(*DtmRequest))
|
||||||
@ -120,13 +89,9 @@ func _Dtm_Submit_Handler(srv interface{}, ctx context.Context, dec func(interfac
|
|||||||
// It's only intended for direct use with grpc.RegisterService,
|
// It's only intended for direct use with grpc.RegisterService,
|
||||||
// and not to be introspected or modified (even as a copy)
|
// and not to be introspected or modified (even as a copy)
|
||||||
var Dtm_ServiceDesc = grpc.ServiceDesc{
|
var Dtm_ServiceDesc = grpc.ServiceDesc{
|
||||||
ServiceName: "dtmcli.Dtm",
|
ServiceName: "dtmpb.Dtm",
|
||||||
HandlerType: (*DtmServer)(nil),
|
HandlerType: (*DtmServer)(nil),
|
||||||
Methods: []grpc.MethodDesc{
|
Methods: []grpc.MethodDesc{
|
||||||
{
|
|
||||||
MethodName: "Call",
|
|
||||||
Handler: _Dtm_Call_Handler,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
MethodName: "Submit",
|
MethodName: "Submit",
|
||||||
Handler: _Dtm_Submit_Handler,
|
Handler: _Dtm_Submit_Handler,
|
||||||
|
|||||||
@ -8,27 +8,14 @@ import (
|
|||||||
|
|
||||||
// MsgGrpc reliable msg type
|
// MsgGrpc reliable msg type
|
||||||
type MsgGrpc struct {
|
type MsgGrpc struct {
|
||||||
MsgDataGrpc
|
dtmcli.MsgData
|
||||||
dtmcli.TransBase
|
dtmcli.TransBase
|
||||||
}
|
}
|
||||||
|
|
||||||
// MsgDataGrpc msg data
|
|
||||||
type MsgDataGrpc struct {
|
|
||||||
dtmcli.TransData
|
|
||||||
Steps []MsgStepGrpc `json:"steps"`
|
|
||||||
QueryPrepared string `json:"query_prepared"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// MsgStepGrpc struct of one step msg
|
|
||||||
type MsgStepGrpc struct {
|
|
||||||
Action string `json:"action"`
|
|
||||||
Data string `json:"data"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// NewMsgGrpc create new msg
|
// NewMsgGrpc create new msg
|
||||||
func NewMsgGrpc(server string, gid string) *MsgGrpc {
|
func NewMsgGrpc(server string, gid string) *MsgGrpc {
|
||||||
return &MsgGrpc{
|
return &MsgGrpc{
|
||||||
MsgDataGrpc: MsgDataGrpc{TransData: dtmcli.TransData{
|
MsgData: dtmcli.MsgData{TransData: dtmcli.TransData{
|
||||||
Gid: gid,
|
Gid: gid,
|
||||||
TransType: "msg",
|
TransType: "msg",
|
||||||
}},
|
}},
|
||||||
@ -40,8 +27,7 @@ func NewMsgGrpc(server string, gid string) *MsgGrpc {
|
|||||||
|
|
||||||
// Add add a new step
|
// Add add a new step
|
||||||
func (s *MsgGrpc) Add(action string, data []byte) *MsgGrpc {
|
func (s *MsgGrpc) Add(action string, data []byte) *MsgGrpc {
|
||||||
dtmcli.Logf("msg %s Add %s %v", s.MsgDataGrpc.Gid, action, string(data))
|
step := dtmcli.MsgStep{
|
||||||
step := MsgStepGrpc{
|
|
||||||
Action: action,
|
Action: action,
|
||||||
Data: string(data),
|
Data: string(data),
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,9 +2,9 @@ package dtmsvr
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"log"
|
|
||||||
|
|
||||||
pb "github.com/yedf/dtm/dtmpb"
|
pb "github.com/yedf/dtm/dtmpb"
|
||||||
|
"google.golang.org/protobuf/types/known/emptypb"
|
||||||
)
|
)
|
||||||
|
|
||||||
// dtmServer is used to implement helloworld.GreeterServer.
|
// dtmServer is used to implement helloworld.GreeterServer.
|
||||||
@ -12,12 +12,7 @@ type dtmServer struct {
|
|||||||
pb.UnimplementedDtmServer
|
pb.UnimplementedDtmServer
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *dtmServer) Call(ctx context.Context, in *pb.DtmRequest) (*pb.DtmReply, error) {
|
func (s *dtmServer) Submit(ctx context.Context, in *pb.DtmRequest) (*emptypb.Empty, error) {
|
||||||
log.Printf("dtmServer Received: %v", in)
|
|
||||||
return &pb.DtmReply{DtmResult: "SUCCESS", DtmMessage: "ok"}, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (s *dtmServer) Submit(ctx context.Context, in *pb.DtmRequest) (*pb.DtmReply, error) {
|
|
||||||
svcSubmit(TransFromDtmRequest(in), in.WaitResult)
|
svcSubmit(TransFromDtmRequest(in), in.WaitResult)
|
||||||
return &pb.DtmReply{DtmResult: "SUCCESS", DtmMessage: "ok"}, nil
|
return &emptypb.Empty{}, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@ -10,6 +10,9 @@ import (
|
|||||||
"github.com/yedf/dtm/common"
|
"github.com/yedf/dtm/common"
|
||||||
"github.com/yedf/dtm/dtmcli"
|
"github.com/yedf/dtm/dtmcli"
|
||||||
"github.com/yedf/dtm/dtmpb"
|
"github.com/yedf/dtm/dtmpb"
|
||||||
|
"google.golang.org/grpc/codes"
|
||||||
|
"google.golang.org/grpc/status"
|
||||||
|
"google.golang.org/protobuf/types/known/emptypb"
|
||||||
"gorm.io/gorm"
|
"gorm.io/gorm"
|
||||||
"gorm.io/gorm/clause"
|
"gorm.io/gorm/clause"
|
||||||
)
|
)
|
||||||
@ -159,7 +162,6 @@ func (t *TransGlobal) getBranchResult(branch *TransBranch) string {
|
|||||||
if t.Protocol == "grpc" {
|
if t.Protocol == "grpc" {
|
||||||
server, method := dtmpb.GetServerAndMethod(branch.URL)
|
server, method := dtmpb.GetServerAndMethod(branch.URL)
|
||||||
conn := dtmpb.MustGetGrpcConn(server)
|
conn := dtmpb.MustGetGrpcConn(server)
|
||||||
reply := dtmpb.BusiReply{}
|
|
||||||
err := conn.Invoke(context.Background(), method, &dtmpb.BusiRequest{
|
err := conn.Invoke(context.Background(), method, &dtmpb.BusiRequest{
|
||||||
Info: &dtmpb.DtmTransInfo{
|
Info: &dtmpb.DtmTransInfo{
|
||||||
Gid: t.Gid,
|
Gid: t.Gid,
|
||||||
@ -168,9 +170,13 @@ func (t *TransGlobal) getBranchResult(branch *TransBranch) string {
|
|||||||
BranchType: branch.BranchType,
|
BranchType: branch.BranchType,
|
||||||
},
|
},
|
||||||
AppData: []byte(branch.Data),
|
AppData: []byte(branch.Data),
|
||||||
}, &reply)
|
}, &emptypb.Empty{})
|
||||||
e2p(err)
|
if err == nil {
|
||||||
return reply.DtmResult
|
return "SUCCESS"
|
||||||
|
} else if status.Code(err) == codes.Aborted {
|
||||||
|
return "FAILURE"
|
||||||
|
}
|
||||||
|
return err.Error()
|
||||||
}
|
}
|
||||||
resp, err := dtmcli.RestyClient.R().SetBody(branch.Data).
|
resp, err := dtmcli.RestyClient.R().SetBody(branch.Data).
|
||||||
SetQueryParams(dtmcli.MS{
|
SetQueryParams(dtmcli.MS{
|
||||||
|
|||||||
@ -10,6 +10,7 @@ import (
|
|||||||
dtmpb "github.com/yedf/dtm/dtmpb"
|
dtmpb "github.com/yedf/dtm/dtmpb"
|
||||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||||
|
emptypb "google.golang.org/protobuf/types/known/emptypb"
|
||||||
reflect "reflect"
|
reflect "reflect"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -26,46 +27,44 @@ var file_examples_busi_proto_rawDesc = []byte{
|
|||||||
0x0a, 0x13, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2f, 0x62, 0x75, 0x73, 0x69, 0x2e,
|
0x0a, 0x13, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2f, 0x62, 0x75, 0x73, 0x69, 0x2e,
|
||||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x08, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x1a,
|
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x08, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x1a,
|
||||||
0x11, 0x64, 0x74, 0x6d, 0x70, 0x62, 0x2f, 0x64, 0x74, 0x6d, 0x70, 0x62, 0x2e, 0x70, 0x72, 0x6f,
|
0x11, 0x64, 0x74, 0x6d, 0x70, 0x62, 0x2f, 0x64, 0x74, 0x6d, 0x70, 0x62, 0x2e, 0x70, 0x72, 0x6f,
|
||||||
0x74, 0x6f, 0x32, 0x9a, 0x02, 0x0a, 0x04, 0x42, 0x75, 0x73, 0x69, 0x12, 0x30, 0x0a, 0x04, 0x43,
|
0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||||
0x61, 0x6c, 0x6c, 0x12, 0x13, 0x2e, 0x64, 0x74, 0x6d, 0x63, 0x6c, 0x69, 0x2e, 0x42, 0x75, 0x73,
|
0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32,
|
||||||
0x69, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x64, 0x74, 0x6d, 0x63, 0x6c,
|
0xf8, 0x01, 0x0a, 0x04, 0x42, 0x75, 0x73, 0x69, 0x12, 0x37, 0x0a, 0x07, 0x54, 0x72, 0x61, 0x6e,
|
||||||
0x69, 0x2e, 0x42, 0x75, 0x73, 0x69, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x33, 0x0a,
|
0x73, 0x49, 0x6e, 0x12, 0x12, 0x2e, 0x64, 0x74, 0x6d, 0x70, 0x62, 0x2e, 0x42, 0x75, 0x73, 0x69,
|
||||||
0x07, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x49, 0x6e, 0x12, 0x13, 0x2e, 0x64, 0x74, 0x6d, 0x63, 0x6c,
|
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
|
||||||
0x69, 0x2e, 0x42, 0x75, 0x73, 0x69, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e,
|
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22,
|
||||||
0x64, 0x74, 0x6d, 0x63, 0x6c, 0x69, 0x2e, 0x42, 0x75, 0x73, 0x69, 0x52, 0x65, 0x70, 0x6c, 0x79,
|
0x00, 0x12, 0x38, 0x0a, 0x08, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x4f, 0x75, 0x74, 0x12, 0x12, 0x2e,
|
||||||
0x22, 0x00, 0x12, 0x34, 0x0a, 0x08, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x4f, 0x75, 0x74, 0x12, 0x13,
|
0x64, 0x74, 0x6d, 0x70, 0x62, 0x2e, 0x42, 0x75, 0x73, 0x69, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
|
||||||
0x2e, 0x64, 0x74, 0x6d, 0x63, 0x6c, 0x69, 0x2e, 0x42, 0x75, 0x73, 0x69, 0x52, 0x65, 0x71, 0x75,
|
0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||||
0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x64, 0x74, 0x6d, 0x63, 0x6c, 0x69, 0x2e, 0x42, 0x75, 0x73,
|
0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x3d, 0x0a, 0x0d, 0x54,
|
||||||
0x69, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x39, 0x0a, 0x0d, 0x54, 0x72, 0x61, 0x6e,
|
0x72, 0x61, 0x6e, 0x73, 0x49, 0x6e, 0x52, 0x65, 0x76, 0x65, 0x72, 0x74, 0x12, 0x12, 0x2e, 0x64,
|
||||||
0x73, 0x49, 0x6e, 0x52, 0x65, 0x76, 0x65, 0x72, 0x74, 0x12, 0x13, 0x2e, 0x64, 0x74, 0x6d, 0x63,
|
0x74, 0x6d, 0x70, 0x62, 0x2e, 0x42, 0x75, 0x73, 0x69, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
|
||||||
0x6c, 0x69, 0x2e, 0x42, 0x75, 0x73, 0x69, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11,
|
0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
|
||||||
0x2e, 0x64, 0x74, 0x6d, 0x63, 0x6c, 0x69, 0x2e, 0x42, 0x75, 0x73, 0x69, 0x52, 0x65, 0x70, 0x6c,
|
0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x3e, 0x0a, 0x0e, 0x54, 0x72,
|
||||||
0x79, 0x22, 0x00, 0x12, 0x3a, 0x0a, 0x0e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x4f, 0x75, 0x74, 0x52,
|
0x61, 0x6e, 0x73, 0x4f, 0x75, 0x74, 0x52, 0x65, 0x76, 0x65, 0x72, 0x74, 0x12, 0x12, 0x2e, 0x64,
|
||||||
0x65, 0x76, 0x65, 0x72, 0x74, 0x12, 0x13, 0x2e, 0x64, 0x74, 0x6d, 0x63, 0x6c, 0x69, 0x2e, 0x42,
|
0x74, 0x6d, 0x70, 0x62, 0x2e, 0x42, 0x75, 0x73, 0x69, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
|
||||||
0x75, 0x73, 0x69, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x64, 0x74, 0x6d,
|
0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
|
||||||
0x63, 0x6c, 0x69, 0x2e, 0x42, 0x75, 0x73, 0x69, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x42,
|
0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x42, 0x1e, 0x5a, 0x1c, 0x67, 0x69,
|
||||||
0x1e, 0x5a, 0x1c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x79, 0x65,
|
0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x79, 0x65, 0x64, 0x66, 0x2f, 0x64, 0x74,
|
||||||
0x64, 0x66, 0x2f, 0x64, 0x74, 0x6d, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x62,
|
0x6d, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
|
||||||
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
0x6f, 0x33,
|
||||||
}
|
}
|
||||||
|
|
||||||
var file_examples_busi_proto_goTypes = []interface{}{
|
var file_examples_busi_proto_goTypes = []interface{}{
|
||||||
(*dtmpb.BusiRequest)(nil), // 0: dtmcli.BusiRequest
|
(*dtmpb.BusiRequest)(nil), // 0: dtmpb.BusiRequest
|
||||||
(*dtmpb.BusiReply)(nil), // 1: dtmcli.BusiReply
|
(*emptypb.Empty)(nil), // 1: google.protobuf.Empty
|
||||||
}
|
}
|
||||||
var file_examples_busi_proto_depIdxs = []int32{
|
var file_examples_busi_proto_depIdxs = []int32{
|
||||||
0, // 0: examples.Busi.Call:input_type -> dtmcli.BusiRequest
|
0, // 0: examples.Busi.TransIn:input_type -> dtmpb.BusiRequest
|
||||||
0, // 1: examples.Busi.TransIn:input_type -> dtmcli.BusiRequest
|
0, // 1: examples.Busi.TransOut:input_type -> dtmpb.BusiRequest
|
||||||
0, // 2: examples.Busi.TransOut:input_type -> dtmcli.BusiRequest
|
0, // 2: examples.Busi.TransInRevert:input_type -> dtmpb.BusiRequest
|
||||||
0, // 3: examples.Busi.TransInRevert:input_type -> dtmcli.BusiRequest
|
0, // 3: examples.Busi.TransOutRevert:input_type -> dtmpb.BusiRequest
|
||||||
0, // 4: examples.Busi.TransOutRevert:input_type -> dtmcli.BusiRequest
|
1, // 4: examples.Busi.TransIn:output_type -> google.protobuf.Empty
|
||||||
1, // 5: examples.Busi.Call:output_type -> dtmcli.BusiReply
|
1, // 5: examples.Busi.TransOut:output_type -> google.protobuf.Empty
|
||||||
1, // 6: examples.Busi.TransIn:output_type -> dtmcli.BusiReply
|
1, // 6: examples.Busi.TransInRevert:output_type -> google.protobuf.Empty
|
||||||
1, // 7: examples.Busi.TransOut:output_type -> dtmcli.BusiReply
|
1, // 7: examples.Busi.TransOutRevert:output_type -> google.protobuf.Empty
|
||||||
1, // 8: examples.Busi.TransInRevert:output_type -> dtmcli.BusiReply
|
4, // [4:8] is the sub-list for method output_type
|
||||||
1, // 9: examples.Busi.TransOutRevert:output_type -> dtmcli.BusiReply
|
0, // [0:4] is the sub-list for method input_type
|
||||||
5, // [5:10] is the sub-list for method output_type
|
|
||||||
0, // [0:5] is the sub-list for method input_type
|
|
||||||
0, // [0:0] is the sub-list for extension type_name
|
0, // [0:0] is the sub-list for extension type_name
|
||||||
0, // [0:0] is the sub-list for extension extendee
|
0, // [0:0] is the sub-list for extension extendee
|
||||||
0, // [0:0] is the sub-list for field type_name
|
0, // [0:0] is the sub-list for field type_name
|
||||||
|
|||||||
@ -4,14 +4,13 @@ package examples;
|
|||||||
|
|
||||||
option go_package = "github.com/yedf/dtm/examples";
|
option go_package = "github.com/yedf/dtm/examples";
|
||||||
import "dtmpb/dtmpb.proto";
|
import "dtmpb/dtmpb.proto";
|
||||||
|
import "google/protobuf/empty.proto";
|
||||||
|
|
||||||
// The dtm service definition.
|
// The dtm service definition.
|
||||||
service Busi {
|
service Busi {
|
||||||
rpc Call(dtmcli.BusiRequest) returns (dtmcli.BusiReply) {}
|
rpc TransIn(dtmpb.BusiRequest) returns (google.protobuf.Empty) {}
|
||||||
|
rpc TransOut(dtmpb.BusiRequest) returns (google.protobuf.Empty) {}
|
||||||
rpc TransIn(dtmcli.BusiRequest) returns (dtmcli.BusiReply) {}
|
rpc TransInRevert(dtmpb.BusiRequest) returns (google.protobuf.Empty) {}
|
||||||
rpc TransOut(dtmcli.BusiRequest) returns (dtmcli.BusiReply) {}
|
rpc TransOutRevert(dtmpb.BusiRequest) returns (google.protobuf.Empty) {}
|
||||||
rpc TransInRevert(dtmcli.BusiRequest) returns (dtmcli.BusiReply) {}
|
|
||||||
rpc TransOutRevert(dtmcli.BusiRequest) returns (dtmcli.BusiReply) {}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -8,6 +8,7 @@ import (
|
|||||||
grpc "google.golang.org/grpc"
|
grpc "google.golang.org/grpc"
|
||||||
codes "google.golang.org/grpc/codes"
|
codes "google.golang.org/grpc/codes"
|
||||||
status "google.golang.org/grpc/status"
|
status "google.golang.org/grpc/status"
|
||||||
|
emptypb "google.golang.org/protobuf/types/known/emptypb"
|
||||||
)
|
)
|
||||||
|
|
||||||
// This is a compile-time assertion to ensure that this generated file
|
// This is a compile-time assertion to ensure that this generated file
|
||||||
@ -19,11 +20,10 @@ const _ = grpc.SupportPackageIsVersion7
|
|||||||
//
|
//
|
||||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||||
type BusiClient interface {
|
type BusiClient interface {
|
||||||
Call(ctx context.Context, in *dtmpb.BusiRequest, opts ...grpc.CallOption) (*dtmpb.BusiReply, error)
|
TransIn(ctx context.Context, in *dtmpb.BusiRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
||||||
TransIn(ctx context.Context, in *dtmpb.BusiRequest, opts ...grpc.CallOption) (*dtmpb.BusiReply, error)
|
TransOut(ctx context.Context, in *dtmpb.BusiRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
||||||
TransOut(ctx context.Context, in *dtmpb.BusiRequest, opts ...grpc.CallOption) (*dtmpb.BusiReply, error)
|
TransInRevert(ctx context.Context, in *dtmpb.BusiRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
||||||
TransInRevert(ctx context.Context, in *dtmpb.BusiRequest, opts ...grpc.CallOption) (*dtmpb.BusiReply, error)
|
TransOutRevert(ctx context.Context, in *dtmpb.BusiRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
||||||
TransOutRevert(ctx context.Context, in *dtmpb.BusiRequest, opts ...grpc.CallOption) (*dtmpb.BusiReply, error)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type busiClient struct {
|
type busiClient struct {
|
||||||
@ -34,17 +34,8 @@ func NewBusiClient(cc grpc.ClientConnInterface) BusiClient {
|
|||||||
return &busiClient{cc}
|
return &busiClient{cc}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *busiClient) Call(ctx context.Context, in *dtmpb.BusiRequest, opts ...grpc.CallOption) (*dtmpb.BusiReply, error) {
|
func (c *busiClient) TransIn(ctx context.Context, in *dtmpb.BusiRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
||||||
out := new(dtmpb.BusiReply)
|
out := new(emptypb.Empty)
|
||||||
err := c.cc.Invoke(ctx, "/examples.Busi/Call", in, out, opts...)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return out, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *busiClient) TransIn(ctx context.Context, in *dtmpb.BusiRequest, opts ...grpc.CallOption) (*dtmpb.BusiReply, error) {
|
|
||||||
out := new(dtmpb.BusiReply)
|
|
||||||
err := c.cc.Invoke(ctx, "/examples.Busi/TransIn", in, out, opts...)
|
err := c.cc.Invoke(ctx, "/examples.Busi/TransIn", in, out, opts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@ -52,8 +43,8 @@ func (c *busiClient) TransIn(ctx context.Context, in *dtmpb.BusiRequest, opts ..
|
|||||||
return out, nil
|
return out, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *busiClient) TransOut(ctx context.Context, in *dtmpb.BusiRequest, opts ...grpc.CallOption) (*dtmpb.BusiReply, error) {
|
func (c *busiClient) TransOut(ctx context.Context, in *dtmpb.BusiRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
||||||
out := new(dtmpb.BusiReply)
|
out := new(emptypb.Empty)
|
||||||
err := c.cc.Invoke(ctx, "/examples.Busi/TransOut", in, out, opts...)
|
err := c.cc.Invoke(ctx, "/examples.Busi/TransOut", in, out, opts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@ -61,8 +52,8 @@ func (c *busiClient) TransOut(ctx context.Context, in *dtmpb.BusiRequest, opts .
|
|||||||
return out, nil
|
return out, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *busiClient) TransInRevert(ctx context.Context, in *dtmpb.BusiRequest, opts ...grpc.CallOption) (*dtmpb.BusiReply, error) {
|
func (c *busiClient) TransInRevert(ctx context.Context, in *dtmpb.BusiRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
||||||
out := new(dtmpb.BusiReply)
|
out := new(emptypb.Empty)
|
||||||
err := c.cc.Invoke(ctx, "/examples.Busi/TransInRevert", in, out, opts...)
|
err := c.cc.Invoke(ctx, "/examples.Busi/TransInRevert", in, out, opts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@ -70,8 +61,8 @@ func (c *busiClient) TransInRevert(ctx context.Context, in *dtmpb.BusiRequest, o
|
|||||||
return out, nil
|
return out, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *busiClient) TransOutRevert(ctx context.Context, in *dtmpb.BusiRequest, opts ...grpc.CallOption) (*dtmpb.BusiReply, error) {
|
func (c *busiClient) TransOutRevert(ctx context.Context, in *dtmpb.BusiRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
||||||
out := new(dtmpb.BusiReply)
|
out := new(emptypb.Empty)
|
||||||
err := c.cc.Invoke(ctx, "/examples.Busi/TransOutRevert", in, out, opts...)
|
err := c.cc.Invoke(ctx, "/examples.Busi/TransOutRevert", in, out, opts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@ -83,11 +74,10 @@ func (c *busiClient) TransOutRevert(ctx context.Context, in *dtmpb.BusiRequest,
|
|||||||
// All implementations must embed UnimplementedBusiServer
|
// All implementations must embed UnimplementedBusiServer
|
||||||
// for forward compatibility
|
// for forward compatibility
|
||||||
type BusiServer interface {
|
type BusiServer interface {
|
||||||
Call(context.Context, *dtmpb.BusiRequest) (*dtmpb.BusiReply, error)
|
TransIn(context.Context, *dtmpb.BusiRequest) (*emptypb.Empty, error)
|
||||||
TransIn(context.Context, *dtmpb.BusiRequest) (*dtmpb.BusiReply, error)
|
TransOut(context.Context, *dtmpb.BusiRequest) (*emptypb.Empty, error)
|
||||||
TransOut(context.Context, *dtmpb.BusiRequest) (*dtmpb.BusiReply, error)
|
TransInRevert(context.Context, *dtmpb.BusiRequest) (*emptypb.Empty, error)
|
||||||
TransInRevert(context.Context, *dtmpb.BusiRequest) (*dtmpb.BusiReply, error)
|
TransOutRevert(context.Context, *dtmpb.BusiRequest) (*emptypb.Empty, error)
|
||||||
TransOutRevert(context.Context, *dtmpb.BusiRequest) (*dtmpb.BusiReply, error)
|
|
||||||
mustEmbedUnimplementedBusiServer()
|
mustEmbedUnimplementedBusiServer()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -95,19 +85,16 @@ type BusiServer interface {
|
|||||||
type UnimplementedBusiServer struct {
|
type UnimplementedBusiServer struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (UnimplementedBusiServer) Call(context.Context, *dtmpb.BusiRequest) (*dtmpb.BusiReply, error) {
|
func (UnimplementedBusiServer) TransIn(context.Context, *dtmpb.BusiRequest) (*emptypb.Empty, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method Call not implemented")
|
|
||||||
}
|
|
||||||
func (UnimplementedBusiServer) TransIn(context.Context, *dtmpb.BusiRequest) (*dtmpb.BusiReply, error) {
|
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method TransIn not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method TransIn not implemented")
|
||||||
}
|
}
|
||||||
func (UnimplementedBusiServer) TransOut(context.Context, *dtmpb.BusiRequest) (*dtmpb.BusiReply, error) {
|
func (UnimplementedBusiServer) TransOut(context.Context, *dtmpb.BusiRequest) (*emptypb.Empty, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method TransOut not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method TransOut not implemented")
|
||||||
}
|
}
|
||||||
func (UnimplementedBusiServer) TransInRevert(context.Context, *dtmpb.BusiRequest) (*dtmpb.BusiReply, error) {
|
func (UnimplementedBusiServer) TransInRevert(context.Context, *dtmpb.BusiRequest) (*emptypb.Empty, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method TransInRevert not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method TransInRevert not implemented")
|
||||||
}
|
}
|
||||||
func (UnimplementedBusiServer) TransOutRevert(context.Context, *dtmpb.BusiRequest) (*dtmpb.BusiReply, error) {
|
func (UnimplementedBusiServer) TransOutRevert(context.Context, *dtmpb.BusiRequest) (*emptypb.Empty, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method TransOutRevert not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method TransOutRevert not implemented")
|
||||||
}
|
}
|
||||||
func (UnimplementedBusiServer) mustEmbedUnimplementedBusiServer() {}
|
func (UnimplementedBusiServer) mustEmbedUnimplementedBusiServer() {}
|
||||||
@ -123,24 +110,6 @@ func RegisterBusiServer(s grpc.ServiceRegistrar, srv BusiServer) {
|
|||||||
s.RegisterService(&Busi_ServiceDesc, srv)
|
s.RegisterService(&Busi_ServiceDesc, srv)
|
||||||
}
|
}
|
||||||
|
|
||||||
func _Busi_Call_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
||||||
in := new(dtmpb.BusiRequest)
|
|
||||||
if err := dec(in); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
if interceptor == nil {
|
|
||||||
return srv.(BusiServer).Call(ctx, in)
|
|
||||||
}
|
|
||||||
info := &grpc.UnaryServerInfo{
|
|
||||||
Server: srv,
|
|
||||||
FullMethod: "/examples.Busi/Call",
|
|
||||||
}
|
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
||||||
return srv.(BusiServer).Call(ctx, req.(*dtmpb.BusiRequest))
|
|
||||||
}
|
|
||||||
return interceptor(ctx, in, info, handler)
|
|
||||||
}
|
|
||||||
|
|
||||||
func _Busi_TransIn_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
func _Busi_TransIn_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
in := new(dtmpb.BusiRequest)
|
in := new(dtmpb.BusiRequest)
|
||||||
if err := dec(in); err != nil {
|
if err := dec(in); err != nil {
|
||||||
@ -220,10 +189,6 @@ var Busi_ServiceDesc = grpc.ServiceDesc{
|
|||||||
ServiceName: "examples.Busi",
|
ServiceName: "examples.Busi",
|
||||||
HandlerType: (*BusiServer)(nil),
|
HandlerType: (*BusiServer)(nil),
|
||||||
Methods: []grpc.MethodDesc{
|
Methods: []grpc.MethodDesc{
|
||||||
{
|
|
||||||
MethodName: "Call",
|
|
||||||
Handler: _Busi_Call_Handler,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
MethodName: "TransIn",
|
MethodName: "TransIn",
|
||||||
Handler: _Busi_TransIn_Handler,
|
Handler: _Busi_TransIn_Handler,
|
||||||
|
|||||||
@ -5,6 +5,7 @@ import (
|
|||||||
|
|
||||||
"github.com/yedf/dtm/dtmcli"
|
"github.com/yedf/dtm/dtmcli"
|
||||||
dtmpb "github.com/yedf/dtm/dtmpb"
|
dtmpb "github.com/yedf/dtm/dtmpb"
|
||||||
|
"google.golang.org/protobuf/types/known/emptypb"
|
||||||
)
|
)
|
||||||
|
|
||||||
// busiServer is used to implement helloworld.GreeterServer.
|
// busiServer is used to implement helloworld.GreeterServer.
|
||||||
@ -12,21 +13,16 @@ type busiServer struct {
|
|||||||
UnimplementedBusiServer
|
UnimplementedBusiServer
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *busiServer) Call(ctx context.Context, in *dtmpb.BusiRequest) (*dtmpb.BusiReply, error) {
|
func (s *busiServer) TransIn(ctx context.Context, in *dtmpb.BusiRequest) (*emptypb.Empty, error) {
|
||||||
dtmcli.Logf("busiServer %s received: %v", dtmcli.GetFuncName(), in)
|
|
||||||
return &dtmpb.BusiReply{DtmResult: "SUCCESS", DtmMessage: "ok"}, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (s *busiServer) TransIn(ctx context.Context, in *dtmpb.BusiRequest) (*dtmpb.BusiReply, error) {
|
|
||||||
req := TransReq{}
|
req := TransReq{}
|
||||||
dtmcli.MustUnmarshal(in.AppData, &req)
|
dtmcli.MustUnmarshal(in.AppData, &req)
|
||||||
dtmcli.Logf("busiServer %s received: %v %v", dtmcli.GetFuncName(), in.Info, req)
|
dtmcli.Logf("busiServer %s received: %v %v", dtmcli.GetFuncName(), in.Info, req)
|
||||||
return &dtmpb.BusiReply{DtmResult: "SUCCESS", DtmMessage: "ok"}, nil
|
return &emptypb.Empty{}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *busiServer) TransOut(ctx context.Context, in *dtmpb.BusiRequest) (*dtmpb.BusiReply, error) {
|
func (s *busiServer) TransOut(ctx context.Context, in *dtmpb.BusiRequest) (*emptypb.Empty, error) {
|
||||||
req := TransReq{}
|
req := TransReq{}
|
||||||
dtmcli.MustUnmarshal(in.AppData, &req)
|
dtmcli.MustUnmarshal(in.AppData, &req)
|
||||||
dtmcli.Logf("busiServer %s received: %v %v", dtmcli.GetFuncName(), in.Info, req)
|
dtmcli.Logf("busiServer %s received: %v %v", dtmcli.GetFuncName(), in.Info, req)
|
||||||
return &dtmpb.BusiReply{DtmResult: "SUCCESS", DtmMessage: "ok"}, nil
|
return &emptypb.Empty{}, nil
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user