dr_protocol_idl_grpc.pb.go 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553
  1. // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
  2. // versions:
  3. // - protoc-gen-go-grpc v1.5.1
  4. // - protoc v6.31.0
  5. // source: dr_protocol_idl.proto
  6. package dr_protocol_pb
  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. )
  13. // This is a compile-time assertion to ensure that this generated file
  14. // is compatible with the grpc package it is being compiled against.
  15. // Requires gRPC-Go v1.64.0 or later.
  16. const _ = grpc.SupportPackageIsVersion9
  17. const (
  18. Basic_SoftwareInfo_FullMethodName = "/dr.protocol.Basic/SoftwareInfo"
  19. Basic_GetOptions_FullMethodName = "/dr.protocol.Basic/GetOptions"
  20. )
  21. // BasicClient is the client API for Basic service.
  22. //
  23. // 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.
  24. type BasicClient interface {
  25. SoftwareInfo(ctx context.Context, in *EmptyRequest, opts ...grpc.CallOption) (*SoftwareInfoReply, error)
  26. GetOptions(ctx context.Context, in *OptionRequest, opts ...grpc.CallOption) (*OptionReply, error)
  27. }
  28. type basicClient struct {
  29. cc grpc.ClientConnInterface
  30. }
  31. func NewBasicClient(cc grpc.ClientConnInterface) BasicClient {
  32. return &basicClient{cc}
  33. }
  34. func (c *basicClient) SoftwareInfo(ctx context.Context, in *EmptyRequest, opts ...grpc.CallOption) (*SoftwareInfoReply, error) {
  35. cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
  36. out := new(SoftwareInfoReply)
  37. err := c.cc.Invoke(ctx, Basic_SoftwareInfo_FullMethodName, in, out, cOpts...)
  38. if err != nil {
  39. return nil, err
  40. }
  41. return out, nil
  42. }
  43. func (c *basicClient) GetOptions(ctx context.Context, in *OptionRequest, opts ...grpc.CallOption) (*OptionReply, error) {
  44. cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
  45. out := new(OptionReply)
  46. err := c.cc.Invoke(ctx, Basic_GetOptions_FullMethodName, in, out, cOpts...)
  47. if err != nil {
  48. return nil, err
  49. }
  50. return out, nil
  51. }
  52. // BasicServer is the server API for Basic service.
  53. // All implementations must embed UnimplementedBasicServer
  54. // for forward compatibility.
  55. type BasicServer interface {
  56. SoftwareInfo(context.Context, *EmptyRequest) (*SoftwareInfoReply, error)
  57. GetOptions(context.Context, *OptionRequest) (*OptionReply, error)
  58. mustEmbedUnimplementedBasicServer()
  59. }
  60. // UnimplementedBasicServer must be embedded to have
  61. // forward compatible implementations.
  62. //
  63. // NOTE: this should be embedded by value instead of pointer to avoid a nil
  64. // pointer dereference when methods are called.
  65. type UnimplementedBasicServer struct{}
  66. func (UnimplementedBasicServer) SoftwareInfo(context.Context, *EmptyRequest) (*SoftwareInfoReply, error) {
  67. return nil, status.Errorf(codes.Unimplemented, "method SoftwareInfo not implemented")
  68. }
  69. func (UnimplementedBasicServer) GetOptions(context.Context, *OptionRequest) (*OptionReply, error) {
  70. return nil, status.Errorf(codes.Unimplemented, "method GetOptions not implemented")
  71. }
  72. func (UnimplementedBasicServer) mustEmbedUnimplementedBasicServer() {}
  73. func (UnimplementedBasicServer) testEmbeddedByValue() {}
  74. // UnsafeBasicServer may be embedded to opt out of forward compatibility for this service.
  75. // Use of this interface is not recommended, as added methods to BasicServer will
  76. // result in compilation errors.
  77. type UnsafeBasicServer interface {
  78. mustEmbedUnimplementedBasicServer()
  79. }
  80. func RegisterBasicServer(s grpc.ServiceRegistrar, srv BasicServer) {
  81. // If the following call pancis, it indicates UnimplementedBasicServer was
  82. // embedded by pointer and is nil. This will cause panics if an
  83. // unimplemented method is ever invoked, so we test this at initialization
  84. // time to prevent it from happening at runtime later due to I/O.
  85. if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
  86. t.testEmbeddedByValue()
  87. }
  88. s.RegisterService(&Basic_ServiceDesc, srv)
  89. }
  90. func _Basic_SoftwareInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  91. in := new(EmptyRequest)
  92. if err := dec(in); err != nil {
  93. return nil, err
  94. }
  95. if interceptor == nil {
  96. return srv.(BasicServer).SoftwareInfo(ctx, in)
  97. }
  98. info := &grpc.UnaryServerInfo{
  99. Server: srv,
  100. FullMethod: Basic_SoftwareInfo_FullMethodName,
  101. }
  102. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  103. return srv.(BasicServer).SoftwareInfo(ctx, req.(*EmptyRequest))
  104. }
  105. return interceptor(ctx, in, info, handler)
  106. }
  107. func _Basic_GetOptions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  108. in := new(OptionRequest)
  109. if err := dec(in); err != nil {
  110. return nil, err
  111. }
  112. if interceptor == nil {
  113. return srv.(BasicServer).GetOptions(ctx, in)
  114. }
  115. info := &grpc.UnaryServerInfo{
  116. Server: srv,
  117. FullMethod: Basic_GetOptions_FullMethodName,
  118. }
  119. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  120. return srv.(BasicServer).GetOptions(ctx, req.(*OptionRequest))
  121. }
  122. return interceptor(ctx, in, info, handler)
  123. }
  124. // Basic_ServiceDesc is the grpc.ServiceDesc for Basic service.
  125. // It's only intended for direct use with grpc.RegisterService,
  126. // and not to be introspected or modified (even as a copy)
  127. var Basic_ServiceDesc = grpc.ServiceDesc{
  128. ServiceName: "dr.protocol.Basic",
  129. HandlerType: (*BasicServer)(nil),
  130. Methods: []grpc.MethodDesc{
  131. {
  132. MethodName: "SoftwareInfo",
  133. Handler: _Basic_SoftwareInfo_Handler,
  134. },
  135. {
  136. MethodName: "GetOptions",
  137. Handler: _Basic_GetOptions_Handler,
  138. },
  139. },
  140. Streams: []grpc.StreamDesc{},
  141. Metadata: "dr_protocol_idl.proto",
  142. }
  143. const (
  144. Protocol_GetPatientTypeList_FullMethodName = "/dr.protocol.Protocol/GetPatientTypeList"
  145. Protocol_GetBodyPartList_FullMethodName = "/dr.protocol.Protocol/GetBodyPartList"
  146. Protocol_GetProcedureList_FullMethodName = "/dr.protocol.Protocol/GetProcedureList"
  147. Protocol_GetProcedure_FullMethodName = "/dr.protocol.Protocol/GetProcedure"
  148. Protocol_GetViewList_FullMethodName = "/dr.protocol.Protocol/GetViewList"
  149. Protocol_GetView_FullMethodName = "/dr.protocol.Protocol/GetView"
  150. )
  151. // ProtocolClient is the client API for Protocol service.
  152. //
  153. // 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.
  154. type ProtocolClient interface {
  155. GetPatientTypeList(ctx context.Context, in *PatientTypeRequest, opts ...grpc.CallOption) (*PatientTypeReply, error)
  156. GetBodyPartList(ctx context.Context, in *BodyPartRequest, opts ...grpc.CallOption) (*BodyPartReply, error)
  157. GetProcedureList(ctx context.Context, in *ProcedureRequest, opts ...grpc.CallOption) (*ProcedureReply, error)
  158. GetProcedure(ctx context.Context, in *IDRequest, opts ...grpc.CallOption) (*Procedure, error)
  159. GetViewList(ctx context.Context, in *ViewRequest, opts ...grpc.CallOption) (*ViewReply, error)
  160. GetView(ctx context.Context, in *IDRequest, opts ...grpc.CallOption) (*View, error)
  161. }
  162. type protocolClient struct {
  163. cc grpc.ClientConnInterface
  164. }
  165. func NewProtocolClient(cc grpc.ClientConnInterface) ProtocolClient {
  166. return &protocolClient{cc}
  167. }
  168. func (c *protocolClient) GetPatientTypeList(ctx context.Context, in *PatientTypeRequest, opts ...grpc.CallOption) (*PatientTypeReply, error) {
  169. cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
  170. out := new(PatientTypeReply)
  171. err := c.cc.Invoke(ctx, Protocol_GetPatientTypeList_FullMethodName, in, out, cOpts...)
  172. if err != nil {
  173. return nil, err
  174. }
  175. return out, nil
  176. }
  177. func (c *protocolClient) GetBodyPartList(ctx context.Context, in *BodyPartRequest, opts ...grpc.CallOption) (*BodyPartReply, error) {
  178. cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
  179. out := new(BodyPartReply)
  180. err := c.cc.Invoke(ctx, Protocol_GetBodyPartList_FullMethodName, in, out, cOpts...)
  181. if err != nil {
  182. return nil, err
  183. }
  184. return out, nil
  185. }
  186. func (c *protocolClient) GetProcedureList(ctx context.Context, in *ProcedureRequest, opts ...grpc.CallOption) (*ProcedureReply, error) {
  187. cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
  188. out := new(ProcedureReply)
  189. err := c.cc.Invoke(ctx, Protocol_GetProcedureList_FullMethodName, in, out, cOpts...)
  190. if err != nil {
  191. return nil, err
  192. }
  193. return out, nil
  194. }
  195. func (c *protocolClient) GetProcedure(ctx context.Context, in *IDRequest, opts ...grpc.CallOption) (*Procedure, error) {
  196. cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
  197. out := new(Procedure)
  198. err := c.cc.Invoke(ctx, Protocol_GetProcedure_FullMethodName, in, out, cOpts...)
  199. if err != nil {
  200. return nil, err
  201. }
  202. return out, nil
  203. }
  204. func (c *protocolClient) GetViewList(ctx context.Context, in *ViewRequest, opts ...grpc.CallOption) (*ViewReply, error) {
  205. cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
  206. out := new(ViewReply)
  207. err := c.cc.Invoke(ctx, Protocol_GetViewList_FullMethodName, in, out, cOpts...)
  208. if err != nil {
  209. return nil, err
  210. }
  211. return out, nil
  212. }
  213. func (c *protocolClient) GetView(ctx context.Context, in *IDRequest, opts ...grpc.CallOption) (*View, error) {
  214. cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
  215. out := new(View)
  216. err := c.cc.Invoke(ctx, Protocol_GetView_FullMethodName, in, out, cOpts...)
  217. if err != nil {
  218. return nil, err
  219. }
  220. return out, nil
  221. }
  222. // ProtocolServer is the server API for Protocol service.
  223. // All implementations must embed UnimplementedProtocolServer
  224. // for forward compatibility.
  225. type ProtocolServer interface {
  226. GetPatientTypeList(context.Context, *PatientTypeRequest) (*PatientTypeReply, error)
  227. GetBodyPartList(context.Context, *BodyPartRequest) (*BodyPartReply, error)
  228. GetProcedureList(context.Context, *ProcedureRequest) (*ProcedureReply, error)
  229. GetProcedure(context.Context, *IDRequest) (*Procedure, error)
  230. GetViewList(context.Context, *ViewRequest) (*ViewReply, error)
  231. GetView(context.Context, *IDRequest) (*View, error)
  232. mustEmbedUnimplementedProtocolServer()
  233. }
  234. // UnimplementedProtocolServer must be embedded to have
  235. // forward compatible implementations.
  236. //
  237. // NOTE: this should be embedded by value instead of pointer to avoid a nil
  238. // pointer dereference when methods are called.
  239. type UnimplementedProtocolServer struct{}
  240. func (UnimplementedProtocolServer) GetPatientTypeList(context.Context, *PatientTypeRequest) (*PatientTypeReply, error) {
  241. return nil, status.Errorf(codes.Unimplemented, "method GetPatientTypeList not implemented")
  242. }
  243. func (UnimplementedProtocolServer) GetBodyPartList(context.Context, *BodyPartRequest) (*BodyPartReply, error) {
  244. return nil, status.Errorf(codes.Unimplemented, "method GetBodyPartList not implemented")
  245. }
  246. func (UnimplementedProtocolServer) GetProcedureList(context.Context, *ProcedureRequest) (*ProcedureReply, error) {
  247. return nil, status.Errorf(codes.Unimplemented, "method GetProcedureList not implemented")
  248. }
  249. func (UnimplementedProtocolServer) GetProcedure(context.Context, *IDRequest) (*Procedure, error) {
  250. return nil, status.Errorf(codes.Unimplemented, "method GetProcedure not implemented")
  251. }
  252. func (UnimplementedProtocolServer) GetViewList(context.Context, *ViewRequest) (*ViewReply, error) {
  253. return nil, status.Errorf(codes.Unimplemented, "method GetViewList not implemented")
  254. }
  255. func (UnimplementedProtocolServer) GetView(context.Context, *IDRequest) (*View, error) {
  256. return nil, status.Errorf(codes.Unimplemented, "method GetView not implemented")
  257. }
  258. func (UnimplementedProtocolServer) mustEmbedUnimplementedProtocolServer() {}
  259. func (UnimplementedProtocolServer) testEmbeddedByValue() {}
  260. // UnsafeProtocolServer may be embedded to opt out of forward compatibility for this service.
  261. // Use of this interface is not recommended, as added methods to ProtocolServer will
  262. // result in compilation errors.
  263. type UnsafeProtocolServer interface {
  264. mustEmbedUnimplementedProtocolServer()
  265. }
  266. func RegisterProtocolServer(s grpc.ServiceRegistrar, srv ProtocolServer) {
  267. // If the following call pancis, it indicates UnimplementedProtocolServer was
  268. // embedded by pointer and is nil. This will cause panics if an
  269. // unimplemented method is ever invoked, so we test this at initialization
  270. // time to prevent it from happening at runtime later due to I/O.
  271. if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
  272. t.testEmbeddedByValue()
  273. }
  274. s.RegisterService(&Protocol_ServiceDesc, srv)
  275. }
  276. func _Protocol_GetPatientTypeList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  277. in := new(PatientTypeRequest)
  278. if err := dec(in); err != nil {
  279. return nil, err
  280. }
  281. if interceptor == nil {
  282. return srv.(ProtocolServer).GetPatientTypeList(ctx, in)
  283. }
  284. info := &grpc.UnaryServerInfo{
  285. Server: srv,
  286. FullMethod: Protocol_GetPatientTypeList_FullMethodName,
  287. }
  288. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  289. return srv.(ProtocolServer).GetPatientTypeList(ctx, req.(*PatientTypeRequest))
  290. }
  291. return interceptor(ctx, in, info, handler)
  292. }
  293. func _Protocol_GetBodyPartList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  294. in := new(BodyPartRequest)
  295. if err := dec(in); err != nil {
  296. return nil, err
  297. }
  298. if interceptor == nil {
  299. return srv.(ProtocolServer).GetBodyPartList(ctx, in)
  300. }
  301. info := &grpc.UnaryServerInfo{
  302. Server: srv,
  303. FullMethod: Protocol_GetBodyPartList_FullMethodName,
  304. }
  305. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  306. return srv.(ProtocolServer).GetBodyPartList(ctx, req.(*BodyPartRequest))
  307. }
  308. return interceptor(ctx, in, info, handler)
  309. }
  310. func _Protocol_GetProcedureList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  311. in := new(ProcedureRequest)
  312. if err := dec(in); err != nil {
  313. return nil, err
  314. }
  315. if interceptor == nil {
  316. return srv.(ProtocolServer).GetProcedureList(ctx, in)
  317. }
  318. info := &grpc.UnaryServerInfo{
  319. Server: srv,
  320. FullMethod: Protocol_GetProcedureList_FullMethodName,
  321. }
  322. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  323. return srv.(ProtocolServer).GetProcedureList(ctx, req.(*ProcedureRequest))
  324. }
  325. return interceptor(ctx, in, info, handler)
  326. }
  327. func _Protocol_GetProcedure_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  328. in := new(IDRequest)
  329. if err := dec(in); err != nil {
  330. return nil, err
  331. }
  332. if interceptor == nil {
  333. return srv.(ProtocolServer).GetProcedure(ctx, in)
  334. }
  335. info := &grpc.UnaryServerInfo{
  336. Server: srv,
  337. FullMethod: Protocol_GetProcedure_FullMethodName,
  338. }
  339. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  340. return srv.(ProtocolServer).GetProcedure(ctx, req.(*IDRequest))
  341. }
  342. return interceptor(ctx, in, info, handler)
  343. }
  344. func _Protocol_GetViewList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  345. in := new(ViewRequest)
  346. if err := dec(in); err != nil {
  347. return nil, err
  348. }
  349. if interceptor == nil {
  350. return srv.(ProtocolServer).GetViewList(ctx, in)
  351. }
  352. info := &grpc.UnaryServerInfo{
  353. Server: srv,
  354. FullMethod: Protocol_GetViewList_FullMethodName,
  355. }
  356. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  357. return srv.(ProtocolServer).GetViewList(ctx, req.(*ViewRequest))
  358. }
  359. return interceptor(ctx, in, info, handler)
  360. }
  361. func _Protocol_GetView_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  362. in := new(IDRequest)
  363. if err := dec(in); err != nil {
  364. return nil, err
  365. }
  366. if interceptor == nil {
  367. return srv.(ProtocolServer).GetView(ctx, in)
  368. }
  369. info := &grpc.UnaryServerInfo{
  370. Server: srv,
  371. FullMethod: Protocol_GetView_FullMethodName,
  372. }
  373. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  374. return srv.(ProtocolServer).GetView(ctx, req.(*IDRequest))
  375. }
  376. return interceptor(ctx, in, info, handler)
  377. }
  378. // Protocol_ServiceDesc is the grpc.ServiceDesc for Protocol service.
  379. // It's only intended for direct use with grpc.RegisterService,
  380. // and not to be introspected or modified (even as a copy)
  381. var Protocol_ServiceDesc = grpc.ServiceDesc{
  382. ServiceName: "dr.protocol.Protocol",
  383. HandlerType: (*ProtocolServer)(nil),
  384. Methods: []grpc.MethodDesc{
  385. {
  386. MethodName: "GetPatientTypeList",
  387. Handler: _Protocol_GetPatientTypeList_Handler,
  388. },
  389. {
  390. MethodName: "GetBodyPartList",
  391. Handler: _Protocol_GetBodyPartList_Handler,
  392. },
  393. {
  394. MethodName: "GetProcedureList",
  395. Handler: _Protocol_GetProcedureList_Handler,
  396. },
  397. {
  398. MethodName: "GetProcedure",
  399. Handler: _Protocol_GetProcedure_Handler,
  400. },
  401. {
  402. MethodName: "GetViewList",
  403. Handler: _Protocol_GetViewList_Handler,
  404. },
  405. {
  406. MethodName: "GetView",
  407. Handler: _Protocol_GetView_Handler,
  408. },
  409. },
  410. Streams: []grpc.StreamDesc{},
  411. Metadata: "dr_protocol_idl.proto",
  412. }
  413. const (
  414. Apr_GetApr_FullMethodName = "/dr.protocol.Apr/GetApr"
  415. )
  416. // AprClient is the client API for Apr service.
  417. //
  418. // 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.
  419. type AprClient interface {
  420. GetApr(ctx context.Context, in *AprRequest, opts ...grpc.CallOption) (*AprReply, error)
  421. }
  422. type aprClient struct {
  423. cc grpc.ClientConnInterface
  424. }
  425. func NewAprClient(cc grpc.ClientConnInterface) AprClient {
  426. return &aprClient{cc}
  427. }
  428. func (c *aprClient) GetApr(ctx context.Context, in *AprRequest, opts ...grpc.CallOption) (*AprReply, error) {
  429. cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
  430. out := new(AprReply)
  431. err := c.cc.Invoke(ctx, Apr_GetApr_FullMethodName, in, out, cOpts...)
  432. if err != nil {
  433. return nil, err
  434. }
  435. return out, nil
  436. }
  437. // AprServer is the server API for Apr service.
  438. // All implementations must embed UnimplementedAprServer
  439. // for forward compatibility.
  440. type AprServer interface {
  441. GetApr(context.Context, *AprRequest) (*AprReply, error)
  442. mustEmbedUnimplementedAprServer()
  443. }
  444. // UnimplementedAprServer must be embedded to have
  445. // forward compatible implementations.
  446. //
  447. // NOTE: this should be embedded by value instead of pointer to avoid a nil
  448. // pointer dereference when methods are called.
  449. type UnimplementedAprServer struct{}
  450. func (UnimplementedAprServer) GetApr(context.Context, *AprRequest) (*AprReply, error) {
  451. return nil, status.Errorf(codes.Unimplemented, "method GetApr not implemented")
  452. }
  453. func (UnimplementedAprServer) mustEmbedUnimplementedAprServer() {}
  454. func (UnimplementedAprServer) testEmbeddedByValue() {}
  455. // UnsafeAprServer may be embedded to opt out of forward compatibility for this service.
  456. // Use of this interface is not recommended, as added methods to AprServer will
  457. // result in compilation errors.
  458. type UnsafeAprServer interface {
  459. mustEmbedUnimplementedAprServer()
  460. }
  461. func RegisterAprServer(s grpc.ServiceRegistrar, srv AprServer) {
  462. // If the following call pancis, it indicates UnimplementedAprServer was
  463. // embedded by pointer and is nil. This will cause panics if an
  464. // unimplemented method is ever invoked, so we test this at initialization
  465. // time to prevent it from happening at runtime later due to I/O.
  466. if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
  467. t.testEmbeddedByValue()
  468. }
  469. s.RegisterService(&Apr_ServiceDesc, srv)
  470. }
  471. func _Apr_GetApr_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  472. in := new(AprRequest)
  473. if err := dec(in); err != nil {
  474. return nil, err
  475. }
  476. if interceptor == nil {
  477. return srv.(AprServer).GetApr(ctx, in)
  478. }
  479. info := &grpc.UnaryServerInfo{
  480. Server: srv,
  481. FullMethod: Apr_GetApr_FullMethodName,
  482. }
  483. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  484. return srv.(AprServer).GetApr(ctx, req.(*AprRequest))
  485. }
  486. return interceptor(ctx, in, info, handler)
  487. }
  488. // Apr_ServiceDesc is the grpc.ServiceDesc for Apr service.
  489. // It's only intended for direct use with grpc.RegisterService,
  490. // and not to be introspected or modified (even as a copy)
  491. var Apr_ServiceDesc = grpc.ServiceDesc{
  492. ServiceName: "dr.protocol.Apr",
  493. HandlerType: (*AprServer)(nil),
  494. Methods: []grpc.MethodDesc{
  495. {
  496. MethodName: "GetApr",
  497. Handler: _Apr_GetApr_Handler,
  498. },
  499. },
  500. Streams: []grpc.StreamDesc{},
  501. Metadata: "dr_protocol_idl.proto",
  502. }