dr_protocol_idl_grpc.pb.go 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337
  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. )
  20. // BasicClient is the client API for Basic service.
  21. //
  22. // 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.
  23. type BasicClient interface {
  24. SoftwareInfo(ctx context.Context, in *EmptyRequest, opts ...grpc.CallOption) (*SoftwareInfoReply, error)
  25. }
  26. type basicClient struct {
  27. cc grpc.ClientConnInterface
  28. }
  29. func NewBasicClient(cc grpc.ClientConnInterface) BasicClient {
  30. return &basicClient{cc}
  31. }
  32. func (c *basicClient) SoftwareInfo(ctx context.Context, in *EmptyRequest, opts ...grpc.CallOption) (*SoftwareInfoReply, error) {
  33. cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
  34. out := new(SoftwareInfoReply)
  35. err := c.cc.Invoke(ctx, Basic_SoftwareInfo_FullMethodName, in, out, cOpts...)
  36. if err != nil {
  37. return nil, err
  38. }
  39. return out, nil
  40. }
  41. // BasicServer is the server API for Basic service.
  42. // All implementations must embed UnimplementedBasicServer
  43. // for forward compatibility.
  44. type BasicServer interface {
  45. SoftwareInfo(context.Context, *EmptyRequest) (*SoftwareInfoReply, error)
  46. mustEmbedUnimplementedBasicServer()
  47. }
  48. // UnimplementedBasicServer must be embedded to have
  49. // forward compatible implementations.
  50. //
  51. // NOTE: this should be embedded by value instead of pointer to avoid a nil
  52. // pointer dereference when methods are called.
  53. type UnimplementedBasicServer struct{}
  54. func (UnimplementedBasicServer) SoftwareInfo(context.Context, *EmptyRequest) (*SoftwareInfoReply, error) {
  55. return nil, status.Errorf(codes.Unimplemented, "method SoftwareInfo not implemented")
  56. }
  57. func (UnimplementedBasicServer) mustEmbedUnimplementedBasicServer() {}
  58. func (UnimplementedBasicServer) testEmbeddedByValue() {}
  59. // UnsafeBasicServer may be embedded to opt out of forward compatibility for this service.
  60. // Use of this interface is not recommended, as added methods to BasicServer will
  61. // result in compilation errors.
  62. type UnsafeBasicServer interface {
  63. mustEmbedUnimplementedBasicServer()
  64. }
  65. func RegisterBasicServer(s grpc.ServiceRegistrar, srv BasicServer) {
  66. // If the following call pancis, it indicates UnimplementedBasicServer was
  67. // embedded by pointer and is nil. This will cause panics if an
  68. // unimplemented method is ever invoked, so we test this at initialization
  69. // time to prevent it from happening at runtime later due to I/O.
  70. if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
  71. t.testEmbeddedByValue()
  72. }
  73. s.RegisterService(&Basic_ServiceDesc, srv)
  74. }
  75. func _Basic_SoftwareInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  76. in := new(EmptyRequest)
  77. if err := dec(in); err != nil {
  78. return nil, err
  79. }
  80. if interceptor == nil {
  81. return srv.(BasicServer).SoftwareInfo(ctx, in)
  82. }
  83. info := &grpc.UnaryServerInfo{
  84. Server: srv,
  85. FullMethod: Basic_SoftwareInfo_FullMethodName,
  86. }
  87. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  88. return srv.(BasicServer).SoftwareInfo(ctx, req.(*EmptyRequest))
  89. }
  90. return interceptor(ctx, in, info, handler)
  91. }
  92. // Basic_ServiceDesc is the grpc.ServiceDesc for Basic service.
  93. // It's only intended for direct use with grpc.RegisterService,
  94. // and not to be introspected or modified (even as a copy)
  95. var Basic_ServiceDesc = grpc.ServiceDesc{
  96. ServiceName: "dr.protocol.Basic",
  97. HandlerType: (*BasicServer)(nil),
  98. Methods: []grpc.MethodDesc{
  99. {
  100. MethodName: "SoftwareInfo",
  101. Handler: _Basic_SoftwareInfo_Handler,
  102. },
  103. },
  104. Streams: []grpc.StreamDesc{},
  105. Metadata: "dr_protocol_idl.proto",
  106. }
  107. const (
  108. Protocol_GetPatientType_FullMethodName = "/dr.protocol.Protocol/GetPatientType"
  109. Protocol_GetBodyPart_FullMethodName = "/dr.protocol.Protocol/GetBodyPart"
  110. Protocol_GetProcedure_FullMethodName = "/dr.protocol.Protocol/GetProcedure"
  111. Protocol_GetView_FullMethodName = "/dr.protocol.Protocol/GetView"
  112. )
  113. // ProtocolClient is the client API for Protocol service.
  114. //
  115. // 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.
  116. type ProtocolClient interface {
  117. GetPatientType(ctx context.Context, in *PatientTypeRequest, opts ...grpc.CallOption) (*PatientTypeReply, error)
  118. GetBodyPart(ctx context.Context, in *BodyPartRequest, opts ...grpc.CallOption) (*BodyPartReply, error)
  119. GetProcedure(ctx context.Context, in *ProcedureRequest, opts ...grpc.CallOption) (*ProcedureReply, error)
  120. GetView(ctx context.Context, in *ViewRequest, opts ...grpc.CallOption) (*ViewReply, error)
  121. }
  122. type protocolClient struct {
  123. cc grpc.ClientConnInterface
  124. }
  125. func NewProtocolClient(cc grpc.ClientConnInterface) ProtocolClient {
  126. return &protocolClient{cc}
  127. }
  128. func (c *protocolClient) GetPatientType(ctx context.Context, in *PatientTypeRequest, opts ...grpc.CallOption) (*PatientTypeReply, error) {
  129. cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
  130. out := new(PatientTypeReply)
  131. err := c.cc.Invoke(ctx, Protocol_GetPatientType_FullMethodName, in, out, cOpts...)
  132. if err != nil {
  133. return nil, err
  134. }
  135. return out, nil
  136. }
  137. func (c *protocolClient) GetBodyPart(ctx context.Context, in *BodyPartRequest, opts ...grpc.CallOption) (*BodyPartReply, error) {
  138. cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
  139. out := new(BodyPartReply)
  140. err := c.cc.Invoke(ctx, Protocol_GetBodyPart_FullMethodName, in, out, cOpts...)
  141. if err != nil {
  142. return nil, err
  143. }
  144. return out, nil
  145. }
  146. func (c *protocolClient) GetProcedure(ctx context.Context, in *ProcedureRequest, opts ...grpc.CallOption) (*ProcedureReply, error) {
  147. cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
  148. out := new(ProcedureReply)
  149. err := c.cc.Invoke(ctx, Protocol_GetProcedure_FullMethodName, in, out, cOpts...)
  150. if err != nil {
  151. return nil, err
  152. }
  153. return out, nil
  154. }
  155. func (c *protocolClient) GetView(ctx context.Context, in *ViewRequest, opts ...grpc.CallOption) (*ViewReply, error) {
  156. cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
  157. out := new(ViewReply)
  158. err := c.cc.Invoke(ctx, Protocol_GetView_FullMethodName, in, out, cOpts...)
  159. if err != nil {
  160. return nil, err
  161. }
  162. return out, nil
  163. }
  164. // ProtocolServer is the server API for Protocol service.
  165. // All implementations must embed UnimplementedProtocolServer
  166. // for forward compatibility.
  167. type ProtocolServer interface {
  168. GetPatientType(context.Context, *PatientTypeRequest) (*PatientTypeReply, error)
  169. GetBodyPart(context.Context, *BodyPartRequest) (*BodyPartReply, error)
  170. GetProcedure(context.Context, *ProcedureRequest) (*ProcedureReply, error)
  171. GetView(context.Context, *ViewRequest) (*ViewReply, error)
  172. mustEmbedUnimplementedProtocolServer()
  173. }
  174. // UnimplementedProtocolServer must be embedded to have
  175. // forward compatible implementations.
  176. //
  177. // NOTE: this should be embedded by value instead of pointer to avoid a nil
  178. // pointer dereference when methods are called.
  179. type UnimplementedProtocolServer struct{}
  180. func (UnimplementedProtocolServer) GetPatientType(context.Context, *PatientTypeRequest) (*PatientTypeReply, error) {
  181. return nil, status.Errorf(codes.Unimplemented, "method GetPatientType not implemented")
  182. }
  183. func (UnimplementedProtocolServer) GetBodyPart(context.Context, *BodyPartRequest) (*BodyPartReply, error) {
  184. return nil, status.Errorf(codes.Unimplemented, "method GetBodyPart not implemented")
  185. }
  186. func (UnimplementedProtocolServer) GetProcedure(context.Context, *ProcedureRequest) (*ProcedureReply, error) {
  187. return nil, status.Errorf(codes.Unimplemented, "method GetProcedure not implemented")
  188. }
  189. func (UnimplementedProtocolServer) GetView(context.Context, *ViewRequest) (*ViewReply, error) {
  190. return nil, status.Errorf(codes.Unimplemented, "method GetView not implemented")
  191. }
  192. func (UnimplementedProtocolServer) mustEmbedUnimplementedProtocolServer() {}
  193. func (UnimplementedProtocolServer) testEmbeddedByValue() {}
  194. // UnsafeProtocolServer may be embedded to opt out of forward compatibility for this service.
  195. // Use of this interface is not recommended, as added methods to ProtocolServer will
  196. // result in compilation errors.
  197. type UnsafeProtocolServer interface {
  198. mustEmbedUnimplementedProtocolServer()
  199. }
  200. func RegisterProtocolServer(s grpc.ServiceRegistrar, srv ProtocolServer) {
  201. // If the following call pancis, it indicates UnimplementedProtocolServer was
  202. // embedded by pointer and is nil. This will cause panics if an
  203. // unimplemented method is ever invoked, so we test this at initialization
  204. // time to prevent it from happening at runtime later due to I/O.
  205. if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
  206. t.testEmbeddedByValue()
  207. }
  208. s.RegisterService(&Protocol_ServiceDesc, srv)
  209. }
  210. func _Protocol_GetPatientType_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  211. in := new(PatientTypeRequest)
  212. if err := dec(in); err != nil {
  213. return nil, err
  214. }
  215. if interceptor == nil {
  216. return srv.(ProtocolServer).GetPatientType(ctx, in)
  217. }
  218. info := &grpc.UnaryServerInfo{
  219. Server: srv,
  220. FullMethod: Protocol_GetPatientType_FullMethodName,
  221. }
  222. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  223. return srv.(ProtocolServer).GetPatientType(ctx, req.(*PatientTypeRequest))
  224. }
  225. return interceptor(ctx, in, info, handler)
  226. }
  227. func _Protocol_GetBodyPart_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  228. in := new(BodyPartRequest)
  229. if err := dec(in); err != nil {
  230. return nil, err
  231. }
  232. if interceptor == nil {
  233. return srv.(ProtocolServer).GetBodyPart(ctx, in)
  234. }
  235. info := &grpc.UnaryServerInfo{
  236. Server: srv,
  237. FullMethod: Protocol_GetBodyPart_FullMethodName,
  238. }
  239. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  240. return srv.(ProtocolServer).GetBodyPart(ctx, req.(*BodyPartRequest))
  241. }
  242. return interceptor(ctx, in, info, handler)
  243. }
  244. func _Protocol_GetProcedure_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  245. in := new(ProcedureRequest)
  246. if err := dec(in); err != nil {
  247. return nil, err
  248. }
  249. if interceptor == nil {
  250. return srv.(ProtocolServer).GetProcedure(ctx, in)
  251. }
  252. info := &grpc.UnaryServerInfo{
  253. Server: srv,
  254. FullMethod: Protocol_GetProcedure_FullMethodName,
  255. }
  256. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  257. return srv.(ProtocolServer).GetProcedure(ctx, req.(*ProcedureRequest))
  258. }
  259. return interceptor(ctx, in, info, handler)
  260. }
  261. func _Protocol_GetView_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  262. in := new(ViewRequest)
  263. if err := dec(in); err != nil {
  264. return nil, err
  265. }
  266. if interceptor == nil {
  267. return srv.(ProtocolServer).GetView(ctx, in)
  268. }
  269. info := &grpc.UnaryServerInfo{
  270. Server: srv,
  271. FullMethod: Protocol_GetView_FullMethodName,
  272. }
  273. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  274. return srv.(ProtocolServer).GetView(ctx, req.(*ViewRequest))
  275. }
  276. return interceptor(ctx, in, info, handler)
  277. }
  278. // Protocol_ServiceDesc is the grpc.ServiceDesc for Protocol service.
  279. // It's only intended for direct use with grpc.RegisterService,
  280. // and not to be introspected or modified (even as a copy)
  281. var Protocol_ServiceDesc = grpc.ServiceDesc{
  282. ServiceName: "dr.protocol.Protocol",
  283. HandlerType: (*ProtocolServer)(nil),
  284. Methods: []grpc.MethodDesc{
  285. {
  286. MethodName: "GetPatientType",
  287. Handler: _Protocol_GetPatientType_Handler,
  288. },
  289. {
  290. MethodName: "GetBodyPart",
  291. Handler: _Protocol_GetBodyPart_Handler,
  292. },
  293. {
  294. MethodName: "GetProcedure",
  295. Handler: _Protocol_GetProcedure_Handler,
  296. },
  297. {
  298. MethodName: "GetView",
  299. Handler: _Protocol_GetView_Handler,
  300. },
  301. },
  302. Streams: []grpc.StreamDesc{},
  303. Metadata: "dr_protocol_idl.proto",
  304. }