service.pb.go 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668
  1. // Code generated by protoc-gen-go. DO NOT EDIT.
  2. // versions:
  3. // protoc-gen-go v1.31.0
  4. // protoc v4.24.3
  5. // source: service.proto
  6. package a2s
  7. import (
  8. context "context"
  9. grpc "google.golang.org/grpc"
  10. codes "google.golang.org/grpc/codes"
  11. status "google.golang.org/grpc/status"
  12. protoreflect "google.golang.org/protobuf/reflect/protoreflect"
  13. protoimpl "google.golang.org/protobuf/runtime/protoimpl"
  14. reflect "reflect"
  15. sync "sync"
  16. )
  17. const (
  18. // Verify that this generated code is sufficiently up-to-date.
  19. _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
  20. // Verify that runtime/protoimpl is sufficiently up-to-date.
  21. _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
  22. )
  23. // 请求
  24. type Request struct {
  25. state protoimpl.MessageState
  26. sizeCache protoimpl.SizeCache
  27. unknownFields protoimpl.UnknownFields
  28. Topic string `protobuf:"bytes,1,opt,name=topic,proto3" json:"topic,omitempty"` //主题
  29. Timeout int64 `protobuf:"varint,2,opt,name=timeout,proto3" json:"timeout,omitempty"` //超时设定
  30. Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` //数据序列化
  31. }
  32. func (x *Request) Reset() {
  33. *x = Request{}
  34. if protoimpl.UnsafeEnabled {
  35. mi := &file_service_proto_msgTypes[0]
  36. ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
  37. ms.StoreMessageInfo(mi)
  38. }
  39. }
  40. func (x *Request) String() string {
  41. return protoimpl.X.MessageStringOf(x)
  42. }
  43. func (*Request) ProtoMessage() {}
  44. func (x *Request) ProtoReflect() protoreflect.Message {
  45. mi := &file_service_proto_msgTypes[0]
  46. if protoimpl.UnsafeEnabled && x != nil {
  47. ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
  48. if ms.LoadMessageInfo() == nil {
  49. ms.StoreMessageInfo(mi)
  50. }
  51. return ms
  52. }
  53. return mi.MessageOf(x)
  54. }
  55. // Deprecated: Use Request.ProtoReflect.Descriptor instead.
  56. func (*Request) Descriptor() ([]byte, []int) {
  57. return file_service_proto_rawDescGZIP(), []int{0}
  58. }
  59. func (x *Request) GetTopic() string {
  60. if x != nil {
  61. return x.Topic
  62. }
  63. return ""
  64. }
  65. func (x *Request) GetTimeout() int64 {
  66. if x != nil {
  67. return x.Timeout
  68. }
  69. return 0
  70. }
  71. func (x *Request) GetData() []byte {
  72. if x != nil {
  73. return x.Data
  74. }
  75. return nil
  76. }
  77. // 回应
  78. type Response struct {
  79. state protoimpl.MessageState
  80. sizeCache protoimpl.SizeCache
  81. unknownFields protoimpl.UnknownFields
  82. Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` //返回码
  83. Msg string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"` //
  84. Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` //结构数据
  85. }
  86. func (x *Response) Reset() {
  87. *x = Response{}
  88. if protoimpl.UnsafeEnabled {
  89. mi := &file_service_proto_msgTypes[1]
  90. ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
  91. ms.StoreMessageInfo(mi)
  92. }
  93. }
  94. func (x *Response) String() string {
  95. return protoimpl.X.MessageStringOf(x)
  96. }
  97. func (*Response) ProtoMessage() {}
  98. func (x *Response) ProtoReflect() protoreflect.Message {
  99. mi := &file_service_proto_msgTypes[1]
  100. if protoimpl.UnsafeEnabled && x != nil {
  101. ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
  102. if ms.LoadMessageInfo() == nil {
  103. ms.StoreMessageInfo(mi)
  104. }
  105. return ms
  106. }
  107. return mi.MessageOf(x)
  108. }
  109. // Deprecated: Use Response.ProtoReflect.Descriptor instead.
  110. func (*Response) Descriptor() ([]byte, []int) {
  111. return file_service_proto_rawDescGZIP(), []int{1}
  112. }
  113. func (x *Response) GetCode() int32 {
  114. if x != nil {
  115. return x.Code
  116. }
  117. return 0
  118. }
  119. func (x *Response) GetMsg() string {
  120. if x != nil {
  121. return x.Msg
  122. }
  123. return ""
  124. }
  125. func (x *Response) GetData() []byte {
  126. if x != nil {
  127. return x.Data
  128. }
  129. return nil
  130. }
  131. // 空消息体
  132. type StateReq struct {
  133. state protoimpl.MessageState
  134. sizeCache protoimpl.SizeCache
  135. unknownFields protoimpl.UnknownFields
  136. Topic string `protobuf:"bytes,1,opt,name=topic,proto3" json:"topic,omitempty"`
  137. }
  138. func (x *StateReq) Reset() {
  139. *x = StateReq{}
  140. if protoimpl.UnsafeEnabled {
  141. mi := &file_service_proto_msgTypes[2]
  142. ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
  143. ms.StoreMessageInfo(mi)
  144. }
  145. }
  146. func (x *StateReq) String() string {
  147. return protoimpl.X.MessageStringOf(x)
  148. }
  149. func (*StateReq) ProtoMessage() {}
  150. func (x *StateReq) ProtoReflect() protoreflect.Message {
  151. mi := &file_service_proto_msgTypes[2]
  152. if protoimpl.UnsafeEnabled && x != nil {
  153. ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
  154. if ms.LoadMessageInfo() == nil {
  155. ms.StoreMessageInfo(mi)
  156. }
  157. return ms
  158. }
  159. return mi.MessageOf(x)
  160. }
  161. // Deprecated: Use StateReq.ProtoReflect.Descriptor instead.
  162. func (*StateReq) Descriptor() ([]byte, []int) {
  163. return file_service_proto_rawDescGZIP(), []int{2}
  164. }
  165. func (x *StateReq) GetTopic() string {
  166. if x != nil {
  167. return x.Topic
  168. }
  169. return ""
  170. }
  171. // 状态消息体
  172. type StateResp struct {
  173. state protoimpl.MessageState
  174. sizeCache protoimpl.SizeCache
  175. unknownFields protoimpl.UnknownFields
  176. CurrentRequest int32 `protobuf:"varint,1,opt,name=currentRequest,proto3" json:"currentRequest,omitempty"` //当前处理的请求数
  177. }
  178. func (x *StateResp) Reset() {
  179. *x = StateResp{}
  180. if protoimpl.UnsafeEnabled {
  181. mi := &file_service_proto_msgTypes[3]
  182. ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
  183. ms.StoreMessageInfo(mi)
  184. }
  185. }
  186. func (x *StateResp) String() string {
  187. return protoimpl.X.MessageStringOf(x)
  188. }
  189. func (*StateResp) ProtoMessage() {}
  190. func (x *StateResp) ProtoReflect() protoreflect.Message {
  191. mi := &file_service_proto_msgTypes[3]
  192. if protoimpl.UnsafeEnabled && x != nil {
  193. ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
  194. if ms.LoadMessageInfo() == nil {
  195. ms.StoreMessageInfo(mi)
  196. }
  197. return ms
  198. }
  199. return mi.MessageOf(x)
  200. }
  201. // Deprecated: Use StateResp.ProtoReflect.Descriptor instead.
  202. func (*StateResp) Descriptor() ([]byte, []int) {
  203. return file_service_proto_rawDescGZIP(), []int{3}
  204. }
  205. func (x *StateResp) GetCurrentRequest() int32 {
  206. if x != nil {
  207. return x.CurrentRequest
  208. }
  209. return 0
  210. }
  211. // 发送给nats的消息体
  212. type NatsRequest struct {
  213. state protoimpl.MessageState
  214. sizeCache protoimpl.SizeCache
  215. unknownFields protoimpl.UnknownFields
  216. MsgId string `protobuf:"bytes,1,opt,name=msgId,proto3" json:"msgId,omitempty"`
  217. Timestamp int64 `protobuf:"varint,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
  218. Timeout int64 `protobuf:"varint,3,opt,name=timeout,proto3" json:"timeout,omitempty"`
  219. Data []byte `protobuf:"bytes,4,opt,name=data,proto3" json:"data,omitempty"`
  220. }
  221. func (x *NatsRequest) Reset() {
  222. *x = NatsRequest{}
  223. if protoimpl.UnsafeEnabled {
  224. mi := &file_service_proto_msgTypes[4]
  225. ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
  226. ms.StoreMessageInfo(mi)
  227. }
  228. }
  229. func (x *NatsRequest) String() string {
  230. return protoimpl.X.MessageStringOf(x)
  231. }
  232. func (*NatsRequest) ProtoMessage() {}
  233. func (x *NatsRequest) ProtoReflect() protoreflect.Message {
  234. mi := &file_service_proto_msgTypes[4]
  235. if protoimpl.UnsafeEnabled && x != nil {
  236. ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
  237. if ms.LoadMessageInfo() == nil {
  238. ms.StoreMessageInfo(mi)
  239. }
  240. return ms
  241. }
  242. return mi.MessageOf(x)
  243. }
  244. // Deprecated: Use NatsRequest.ProtoReflect.Descriptor instead.
  245. func (*NatsRequest) Descriptor() ([]byte, []int) {
  246. return file_service_proto_rawDescGZIP(), []int{4}
  247. }
  248. func (x *NatsRequest) GetMsgId() string {
  249. if x != nil {
  250. return x.MsgId
  251. }
  252. return ""
  253. }
  254. func (x *NatsRequest) GetTimestamp() int64 {
  255. if x != nil {
  256. return x.Timestamp
  257. }
  258. return 0
  259. }
  260. func (x *NatsRequest) GetTimeout() int64 {
  261. if x != nil {
  262. return x.Timeout
  263. }
  264. return 0
  265. }
  266. func (x *NatsRequest) GetData() []byte {
  267. if x != nil {
  268. return x.Data
  269. }
  270. return nil
  271. }
  272. // 回应给nats的消息体
  273. type NatsResponse struct {
  274. state protoimpl.MessageState
  275. sizeCache protoimpl.SizeCache
  276. unknownFields protoimpl.UnknownFields
  277. MsgId string `protobuf:"bytes,1,opt,name=msgId,proto3" json:"msgId,omitempty"`
  278. Data []byte `protobuf:"bytes,4,opt,name=data,proto3" json:"data,omitempty"`
  279. }
  280. func (x *NatsResponse) Reset() {
  281. *x = NatsResponse{}
  282. if protoimpl.UnsafeEnabled {
  283. mi := &file_service_proto_msgTypes[5]
  284. ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
  285. ms.StoreMessageInfo(mi)
  286. }
  287. }
  288. func (x *NatsResponse) String() string {
  289. return protoimpl.X.MessageStringOf(x)
  290. }
  291. func (*NatsResponse) ProtoMessage() {}
  292. func (x *NatsResponse) ProtoReflect() protoreflect.Message {
  293. mi := &file_service_proto_msgTypes[5]
  294. if protoimpl.UnsafeEnabled && x != nil {
  295. ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
  296. if ms.LoadMessageInfo() == nil {
  297. ms.StoreMessageInfo(mi)
  298. }
  299. return ms
  300. }
  301. return mi.MessageOf(x)
  302. }
  303. // Deprecated: Use NatsResponse.ProtoReflect.Descriptor instead.
  304. func (*NatsResponse) Descriptor() ([]byte, []int) {
  305. return file_service_proto_rawDescGZIP(), []int{5}
  306. }
  307. func (x *NatsResponse) GetMsgId() string {
  308. if x != nil {
  309. return x.MsgId
  310. }
  311. return ""
  312. }
  313. func (x *NatsResponse) GetData() []byte {
  314. if x != nil {
  315. return x.Data
  316. }
  317. return nil
  318. }
  319. var File_service_proto protoreflect.FileDescriptor
  320. var file_service_proto_rawDesc = []byte{
  321. 0x0a, 0x0d, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12,
  322. 0x04, 0x6d, 0x61, 0x69, 0x6e, 0x22, 0x4d, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
  323. 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
  324. 0x05, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x12, 0x18, 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75,
  325. 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74,
  326. 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04,
  327. 0x64, 0x61, 0x74, 0x61, 0x22, 0x44, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
  328. 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04,
  329. 0x63, 0x6f, 0x64, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28,
  330. 0x09, 0x52, 0x03, 0x6d, 0x73, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03,
  331. 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x20, 0x0a, 0x08, 0x53, 0x74,
  332. 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x18,
  333. 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x22, 0x33, 0x0a, 0x09,
  334. 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x26, 0x0a, 0x0e, 0x63, 0x75, 0x72,
  335. 0x72, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28,
  336. 0x05, 0x52, 0x0e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
  337. 0x74, 0x22, 0x6f, 0x0a, 0x0b, 0x4e, 0x61, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
  338. 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x73, 0x67, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
  339. 0x05, 0x6d, 0x73, 0x67, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74,
  340. 0x61, 0x6d, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73,
  341. 0x74, 0x61, 0x6d, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18,
  342. 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x12,
  343. 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61,
  344. 0x74, 0x61, 0x22, 0x38, 0x0a, 0x0c, 0x4e, 0x61, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
  345. 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x73, 0x67, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28,
  346. 0x09, 0x52, 0x05, 0x6d, 0x73, 0x67, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61,
  347. 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x32, 0x61, 0x0a, 0x06,
  348. 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x27, 0x0a, 0x04, 0x43, 0x61, 0x6c, 0x6c, 0x12, 0x0d,
  349. 0x2e, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e,
  350. 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12,
  351. 0x2e, 0x0a, 0x09, 0x56, 0x69, 0x65, 0x77, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x0e, 0x2e, 0x6d,
  352. 0x61, 0x69, 0x6e, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x0f, 0x2e, 0x6d,
  353. 0x61, 0x69, 0x6e, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x42,
  354. 0x07, 0x5a, 0x05, 0x2e, 0x3b, 0x61, 0x32, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
  355. }
  356. var (
  357. file_service_proto_rawDescOnce sync.Once
  358. file_service_proto_rawDescData = file_service_proto_rawDesc
  359. )
  360. func file_service_proto_rawDescGZIP() []byte {
  361. file_service_proto_rawDescOnce.Do(func() {
  362. file_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_service_proto_rawDescData)
  363. })
  364. return file_service_proto_rawDescData
  365. }
  366. var file_service_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
  367. var file_service_proto_goTypes = []interface{}{
  368. (*Request)(nil), // 0: main.Request
  369. (*Response)(nil), // 1: main.Response
  370. (*StateReq)(nil), // 2: main.StateReq
  371. (*StateResp)(nil), // 3: main.StateResp
  372. (*NatsRequest)(nil), // 4: main.NatsRequest
  373. (*NatsResponse)(nil), // 5: main.NatsResponse
  374. }
  375. var file_service_proto_depIdxs = []int32{
  376. 0, // 0: main.Caller.Call:input_type -> main.Request
  377. 2, // 1: main.Caller.ViewState:input_type -> main.StateReq
  378. 1, // 2: main.Caller.Call:output_type -> main.Response
  379. 3, // 3: main.Caller.ViewState:output_type -> main.StateResp
  380. 2, // [2:4] is the sub-list for method output_type
  381. 0, // [0:2] is the sub-list for method input_type
  382. 0, // [0:0] is the sub-list for extension type_name
  383. 0, // [0:0] is the sub-list for extension extendee
  384. 0, // [0:0] is the sub-list for field type_name
  385. }
  386. func init() { file_service_proto_init() }
  387. func file_service_proto_init() {
  388. if File_service_proto != nil {
  389. return
  390. }
  391. if !protoimpl.UnsafeEnabled {
  392. file_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
  393. switch v := v.(*Request); i {
  394. case 0:
  395. return &v.state
  396. case 1:
  397. return &v.sizeCache
  398. case 2:
  399. return &v.unknownFields
  400. default:
  401. return nil
  402. }
  403. }
  404. file_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
  405. switch v := v.(*Response); i {
  406. case 0:
  407. return &v.state
  408. case 1:
  409. return &v.sizeCache
  410. case 2:
  411. return &v.unknownFields
  412. default:
  413. return nil
  414. }
  415. }
  416. file_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
  417. switch v := v.(*StateReq); i {
  418. case 0:
  419. return &v.state
  420. case 1:
  421. return &v.sizeCache
  422. case 2:
  423. return &v.unknownFields
  424. default:
  425. return nil
  426. }
  427. }
  428. file_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
  429. switch v := v.(*StateResp); i {
  430. case 0:
  431. return &v.state
  432. case 1:
  433. return &v.sizeCache
  434. case 2:
  435. return &v.unknownFields
  436. default:
  437. return nil
  438. }
  439. }
  440. file_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
  441. switch v := v.(*NatsRequest); i {
  442. case 0:
  443. return &v.state
  444. case 1:
  445. return &v.sizeCache
  446. case 2:
  447. return &v.unknownFields
  448. default:
  449. return nil
  450. }
  451. }
  452. file_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
  453. switch v := v.(*NatsResponse); i {
  454. case 0:
  455. return &v.state
  456. case 1:
  457. return &v.sizeCache
  458. case 2:
  459. return &v.unknownFields
  460. default:
  461. return nil
  462. }
  463. }
  464. }
  465. type x struct{}
  466. out := protoimpl.TypeBuilder{
  467. File: protoimpl.DescBuilder{
  468. GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
  469. RawDescriptor: file_service_proto_rawDesc,
  470. NumEnums: 0,
  471. NumMessages: 6,
  472. NumExtensions: 0,
  473. NumServices: 1,
  474. },
  475. GoTypes: file_service_proto_goTypes,
  476. DependencyIndexes: file_service_proto_depIdxs,
  477. MessageInfos: file_service_proto_msgTypes,
  478. }.Build()
  479. File_service_proto = out.File
  480. file_service_proto_rawDesc = nil
  481. file_service_proto_goTypes = nil
  482. file_service_proto_depIdxs = nil
  483. }
  484. // Reference imports to suppress errors if they are not otherwise used.
  485. var _ context.Context
  486. var _ grpc.ClientConnInterface
  487. // This is a compile-time assertion to ensure that this generated file
  488. // is compatible with the grpc package it is being compiled against.
  489. const _ = grpc.SupportPackageIsVersion6
  490. // CallerClient is the client API for Caller service.
  491. //
  492. // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
  493. type CallerClient interface {
  494. // 远程调用
  495. Call(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
  496. // 状态查看
  497. ViewState(ctx context.Context, in *StateReq, opts ...grpc.CallOption) (*StateResp, error)
  498. }
  499. type callerClient struct {
  500. cc grpc.ClientConnInterface
  501. }
  502. func NewCallerClient(cc grpc.ClientConnInterface) CallerClient {
  503. return &callerClient{cc}
  504. }
  505. func (c *callerClient) Call(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) {
  506. out := new(Response)
  507. err := c.cc.Invoke(ctx, "/main.Caller/Call", in, out, opts...)
  508. if err != nil {
  509. return nil, err
  510. }
  511. return out, nil
  512. }
  513. func (c *callerClient) ViewState(ctx context.Context, in *StateReq, opts ...grpc.CallOption) (*StateResp, error) {
  514. out := new(StateResp)
  515. err := c.cc.Invoke(ctx, "/main.Caller/ViewState", in, out, opts...)
  516. if err != nil {
  517. return nil, err
  518. }
  519. return out, nil
  520. }
  521. // CallerServer is the server API for Caller service.
  522. type CallerServer interface {
  523. // 远程调用
  524. Call(context.Context, *Request) (*Response, error)
  525. // 状态查看
  526. ViewState(context.Context, *StateReq) (*StateResp, error)
  527. }
  528. // UnimplementedCallerServer can be embedded to have forward compatible implementations.
  529. type UnimplementedCallerServer struct {
  530. }
  531. func (*UnimplementedCallerServer) Call(context.Context, *Request) (*Response, error) {
  532. return nil, status.Errorf(codes.Unimplemented, "method Call not implemented")
  533. }
  534. func (*UnimplementedCallerServer) ViewState(context.Context, *StateReq) (*StateResp, error) {
  535. return nil, status.Errorf(codes.Unimplemented, "method ViewState not implemented")
  536. }
  537. func RegisterCallerServer(s *grpc.Server, srv CallerServer) {
  538. s.RegisterService(&_Caller_serviceDesc, srv)
  539. }
  540. func _Caller_Call_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  541. in := new(Request)
  542. if err := dec(in); err != nil {
  543. return nil, err
  544. }
  545. if interceptor == nil {
  546. return srv.(CallerServer).Call(ctx, in)
  547. }
  548. info := &grpc.UnaryServerInfo{
  549. Server: srv,
  550. FullMethod: "/main.Caller/Call",
  551. }
  552. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  553. return srv.(CallerServer).Call(ctx, req.(*Request))
  554. }
  555. return interceptor(ctx, in, info, handler)
  556. }
  557. func _Caller_ViewState_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  558. in := new(StateReq)
  559. if err := dec(in); err != nil {
  560. return nil, err
  561. }
  562. if interceptor == nil {
  563. return srv.(CallerServer).ViewState(ctx, in)
  564. }
  565. info := &grpc.UnaryServerInfo{
  566. Server: srv,
  567. FullMethod: "/main.Caller/ViewState",
  568. }
  569. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  570. return srv.(CallerServer).ViewState(ctx, req.(*StateReq))
  571. }
  572. return interceptor(ctx, in, info, handler)
  573. }
  574. var _Caller_serviceDesc = grpc.ServiceDesc{
  575. ServiceName: "main.Caller",
  576. HandlerType: (*CallerServer)(nil),
  577. Methods: []grpc.MethodDesc{
  578. {
  579. MethodName: "Call",
  580. Handler: _Caller_Call_Handler,
  581. },
  582. {
  583. MethodName: "ViewState",
  584. Handler: _Caller_ViewState_Handler,
  585. },
  586. },
  587. Streams: []grpc.StreamDesc{},
  588. Metadata: "service.proto",
  589. }