You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

hub_grpc.pb.go 14 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431
  1. // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
  2. // versions:
  3. // - protoc-gen-go-grpc v1.3.0
  4. // - protoc v4.22.3
  5. // source: pkgs/rpc/hub/hub.proto
  6. package hubrpc
  7. import (
  8. context "context"
  9. rpc "gitlink.org.cn/cloudream/jcs-pub/common/pkgs/rpc"
  10. grpc "google.golang.org/grpc"
  11. codes "google.golang.org/grpc/codes"
  12. status "google.golang.org/grpc/status"
  13. )
  14. // This is a compile-time assertion to ensure that this generated file
  15. // is compatible with the grpc package it is being compiled against.
  16. // Requires gRPC-Go v1.32.0 or later.
  17. const _ = grpc.SupportPackageIsVersion7
  18. const (
  19. Hub_ExecuteIOPlan_FullMethodName = "/hubrpc.Hub/ExecuteIOPlan"
  20. Hub_SendIOStream_FullMethodName = "/hubrpc.Hub/SendIOStream"
  21. Hub_GetIOStream_FullMethodName = "/hubrpc.Hub/GetIOStream"
  22. Hub_SendIOVar_FullMethodName = "/hubrpc.Hub/SendIOVar"
  23. Hub_GetIOVar_FullMethodName = "/hubrpc.Hub/GetIOVar"
  24. Hub_Ping_FullMethodName = "/hubrpc.Hub/Ping"
  25. Hub_GetState_FullMethodName = "/hubrpc.Hub/GetState"
  26. Hub_NotifyUserAccessTokenInvalid_FullMethodName = "/hubrpc.Hub/NotifyUserAccessTokenInvalid"
  27. )
  28. // HubClient is the client API for Hub service.
  29. //
  30. // 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.
  31. type HubClient interface {
  32. ExecuteIOPlan(ctx context.Context, in *rpc.Request, opts ...grpc.CallOption) (*rpc.Response, error)
  33. SendIOStream(ctx context.Context, opts ...grpc.CallOption) (Hub_SendIOStreamClient, error)
  34. GetIOStream(ctx context.Context, in *rpc.Request, opts ...grpc.CallOption) (Hub_GetIOStreamClient, error)
  35. SendIOVar(ctx context.Context, in *rpc.Request, opts ...grpc.CallOption) (*rpc.Response, error)
  36. GetIOVar(ctx context.Context, in *rpc.Request, opts ...grpc.CallOption) (*rpc.Response, error)
  37. Ping(ctx context.Context, in *rpc.Request, opts ...grpc.CallOption) (*rpc.Response, error)
  38. GetState(ctx context.Context, in *rpc.Request, opts ...grpc.CallOption) (*rpc.Response, error)
  39. NotifyUserAccessTokenInvalid(ctx context.Context, in *rpc.Request, opts ...grpc.CallOption) (*rpc.Response, error)
  40. }
  41. type hubClient struct {
  42. cc grpc.ClientConnInterface
  43. }
  44. func NewHubClient(cc grpc.ClientConnInterface) HubClient {
  45. return &hubClient{cc}
  46. }
  47. func (c *hubClient) ExecuteIOPlan(ctx context.Context, in *rpc.Request, opts ...grpc.CallOption) (*rpc.Response, error) {
  48. out := new(rpc.Response)
  49. err := c.cc.Invoke(ctx, Hub_ExecuteIOPlan_FullMethodName, in, out, opts...)
  50. if err != nil {
  51. return nil, err
  52. }
  53. return out, nil
  54. }
  55. func (c *hubClient) SendIOStream(ctx context.Context, opts ...grpc.CallOption) (Hub_SendIOStreamClient, error) {
  56. stream, err := c.cc.NewStream(ctx, &Hub_ServiceDesc.Streams[0], Hub_SendIOStream_FullMethodName, opts...)
  57. if err != nil {
  58. return nil, err
  59. }
  60. x := &hubSendIOStreamClient{stream}
  61. return x, nil
  62. }
  63. type Hub_SendIOStreamClient interface {
  64. Send(*rpc.ChunkedData) error
  65. CloseAndRecv() (*rpc.Response, error)
  66. grpc.ClientStream
  67. }
  68. type hubSendIOStreamClient struct {
  69. grpc.ClientStream
  70. }
  71. func (x *hubSendIOStreamClient) Send(m *rpc.ChunkedData) error {
  72. return x.ClientStream.SendMsg(m)
  73. }
  74. func (x *hubSendIOStreamClient) CloseAndRecv() (*rpc.Response, error) {
  75. if err := x.ClientStream.CloseSend(); err != nil {
  76. return nil, err
  77. }
  78. m := new(rpc.Response)
  79. if err := x.ClientStream.RecvMsg(m); err != nil {
  80. return nil, err
  81. }
  82. return m, nil
  83. }
  84. func (c *hubClient) GetIOStream(ctx context.Context, in *rpc.Request, opts ...grpc.CallOption) (Hub_GetIOStreamClient, error) {
  85. stream, err := c.cc.NewStream(ctx, &Hub_ServiceDesc.Streams[1], Hub_GetIOStream_FullMethodName, opts...)
  86. if err != nil {
  87. return nil, err
  88. }
  89. x := &hubGetIOStreamClient{stream}
  90. if err := x.ClientStream.SendMsg(in); err != nil {
  91. return nil, err
  92. }
  93. if err := x.ClientStream.CloseSend(); err != nil {
  94. return nil, err
  95. }
  96. return x, nil
  97. }
  98. type Hub_GetIOStreamClient interface {
  99. Recv() (*rpc.ChunkedData, error)
  100. grpc.ClientStream
  101. }
  102. type hubGetIOStreamClient struct {
  103. grpc.ClientStream
  104. }
  105. func (x *hubGetIOStreamClient) Recv() (*rpc.ChunkedData, error) {
  106. m := new(rpc.ChunkedData)
  107. if err := x.ClientStream.RecvMsg(m); err != nil {
  108. return nil, err
  109. }
  110. return m, nil
  111. }
  112. func (c *hubClient) SendIOVar(ctx context.Context, in *rpc.Request, opts ...grpc.CallOption) (*rpc.Response, error) {
  113. out := new(rpc.Response)
  114. err := c.cc.Invoke(ctx, Hub_SendIOVar_FullMethodName, in, out, opts...)
  115. if err != nil {
  116. return nil, err
  117. }
  118. return out, nil
  119. }
  120. func (c *hubClient) GetIOVar(ctx context.Context, in *rpc.Request, opts ...grpc.CallOption) (*rpc.Response, error) {
  121. out := new(rpc.Response)
  122. err := c.cc.Invoke(ctx, Hub_GetIOVar_FullMethodName, in, out, opts...)
  123. if err != nil {
  124. return nil, err
  125. }
  126. return out, nil
  127. }
  128. func (c *hubClient) Ping(ctx context.Context, in *rpc.Request, opts ...grpc.CallOption) (*rpc.Response, error) {
  129. out := new(rpc.Response)
  130. err := c.cc.Invoke(ctx, Hub_Ping_FullMethodName, in, out, opts...)
  131. if err != nil {
  132. return nil, err
  133. }
  134. return out, nil
  135. }
  136. func (c *hubClient) GetState(ctx context.Context, in *rpc.Request, opts ...grpc.CallOption) (*rpc.Response, error) {
  137. out := new(rpc.Response)
  138. err := c.cc.Invoke(ctx, Hub_GetState_FullMethodName, in, out, opts...)
  139. if err != nil {
  140. return nil, err
  141. }
  142. return out, nil
  143. }
  144. func (c *hubClient) NotifyUserAccessTokenInvalid(ctx context.Context, in *rpc.Request, opts ...grpc.CallOption) (*rpc.Response, error) {
  145. out := new(rpc.Response)
  146. err := c.cc.Invoke(ctx, Hub_NotifyUserAccessTokenInvalid_FullMethodName, in, out, opts...)
  147. if err != nil {
  148. return nil, err
  149. }
  150. return out, nil
  151. }
  152. // HubServer is the server API for Hub service.
  153. // All implementations must embed UnimplementedHubServer
  154. // for forward compatibility
  155. type HubServer interface {
  156. ExecuteIOPlan(context.Context, *rpc.Request) (*rpc.Response, error)
  157. SendIOStream(Hub_SendIOStreamServer) error
  158. GetIOStream(*rpc.Request, Hub_GetIOStreamServer) error
  159. SendIOVar(context.Context, *rpc.Request) (*rpc.Response, error)
  160. GetIOVar(context.Context, *rpc.Request) (*rpc.Response, error)
  161. Ping(context.Context, *rpc.Request) (*rpc.Response, error)
  162. GetState(context.Context, *rpc.Request) (*rpc.Response, error)
  163. NotifyUserAccessTokenInvalid(context.Context, *rpc.Request) (*rpc.Response, error)
  164. mustEmbedUnimplementedHubServer()
  165. }
  166. // UnimplementedHubServer must be embedded to have forward compatible implementations.
  167. type UnimplementedHubServer struct {
  168. }
  169. func (UnimplementedHubServer) ExecuteIOPlan(context.Context, *rpc.Request) (*rpc.Response, error) {
  170. return nil, status.Errorf(codes.Unimplemented, "method ExecuteIOPlan not implemented")
  171. }
  172. func (UnimplementedHubServer) SendIOStream(Hub_SendIOStreamServer) error {
  173. return status.Errorf(codes.Unimplemented, "method SendIOStream not implemented")
  174. }
  175. func (UnimplementedHubServer) GetIOStream(*rpc.Request, Hub_GetIOStreamServer) error {
  176. return status.Errorf(codes.Unimplemented, "method GetIOStream not implemented")
  177. }
  178. func (UnimplementedHubServer) SendIOVar(context.Context, *rpc.Request) (*rpc.Response, error) {
  179. return nil, status.Errorf(codes.Unimplemented, "method SendIOVar not implemented")
  180. }
  181. func (UnimplementedHubServer) GetIOVar(context.Context, *rpc.Request) (*rpc.Response, error) {
  182. return nil, status.Errorf(codes.Unimplemented, "method GetIOVar not implemented")
  183. }
  184. func (UnimplementedHubServer) Ping(context.Context, *rpc.Request) (*rpc.Response, error) {
  185. return nil, status.Errorf(codes.Unimplemented, "method Ping not implemented")
  186. }
  187. func (UnimplementedHubServer) GetState(context.Context, *rpc.Request) (*rpc.Response, error) {
  188. return nil, status.Errorf(codes.Unimplemented, "method GetState not implemented")
  189. }
  190. func (UnimplementedHubServer) NotifyUserAccessTokenInvalid(context.Context, *rpc.Request) (*rpc.Response, error) {
  191. return nil, status.Errorf(codes.Unimplemented, "method NotifyUserAccessTokenInvalid not implemented")
  192. }
  193. func (UnimplementedHubServer) mustEmbedUnimplementedHubServer() {}
  194. // UnsafeHubServer may be embedded to opt out of forward compatibility for this service.
  195. // Use of this interface is not recommended, as added methods to HubServer will
  196. // result in compilation errors.
  197. type UnsafeHubServer interface {
  198. mustEmbedUnimplementedHubServer()
  199. }
  200. func RegisterHubServer(s grpc.ServiceRegistrar, srv HubServer) {
  201. s.RegisterService(&Hub_ServiceDesc, srv)
  202. }
  203. func _Hub_ExecuteIOPlan_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  204. in := new(rpc.Request)
  205. if err := dec(in); err != nil {
  206. return nil, err
  207. }
  208. if interceptor == nil {
  209. return srv.(HubServer).ExecuteIOPlan(ctx, in)
  210. }
  211. info := &grpc.UnaryServerInfo{
  212. Server: srv,
  213. FullMethod: Hub_ExecuteIOPlan_FullMethodName,
  214. }
  215. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  216. return srv.(HubServer).ExecuteIOPlan(ctx, req.(*rpc.Request))
  217. }
  218. return interceptor(ctx, in, info, handler)
  219. }
  220. func _Hub_SendIOStream_Handler(srv interface{}, stream grpc.ServerStream) error {
  221. return srv.(HubServer).SendIOStream(&hubSendIOStreamServer{stream})
  222. }
  223. type Hub_SendIOStreamServer interface {
  224. SendAndClose(*rpc.Response) error
  225. Recv() (*rpc.ChunkedData, error)
  226. grpc.ServerStream
  227. }
  228. type hubSendIOStreamServer struct {
  229. grpc.ServerStream
  230. }
  231. func (x *hubSendIOStreamServer) SendAndClose(m *rpc.Response) error {
  232. return x.ServerStream.SendMsg(m)
  233. }
  234. func (x *hubSendIOStreamServer) Recv() (*rpc.ChunkedData, error) {
  235. m := new(rpc.ChunkedData)
  236. if err := x.ServerStream.RecvMsg(m); err != nil {
  237. return nil, err
  238. }
  239. return m, nil
  240. }
  241. func _Hub_GetIOStream_Handler(srv interface{}, stream grpc.ServerStream) error {
  242. m := new(rpc.Request)
  243. if err := stream.RecvMsg(m); err != nil {
  244. return err
  245. }
  246. return srv.(HubServer).GetIOStream(m, &hubGetIOStreamServer{stream})
  247. }
  248. type Hub_GetIOStreamServer interface {
  249. Send(*rpc.ChunkedData) error
  250. grpc.ServerStream
  251. }
  252. type hubGetIOStreamServer struct {
  253. grpc.ServerStream
  254. }
  255. func (x *hubGetIOStreamServer) Send(m *rpc.ChunkedData) error {
  256. return x.ServerStream.SendMsg(m)
  257. }
  258. func _Hub_SendIOVar_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  259. in := new(rpc.Request)
  260. if err := dec(in); err != nil {
  261. return nil, err
  262. }
  263. if interceptor == nil {
  264. return srv.(HubServer).SendIOVar(ctx, in)
  265. }
  266. info := &grpc.UnaryServerInfo{
  267. Server: srv,
  268. FullMethod: Hub_SendIOVar_FullMethodName,
  269. }
  270. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  271. return srv.(HubServer).SendIOVar(ctx, req.(*rpc.Request))
  272. }
  273. return interceptor(ctx, in, info, handler)
  274. }
  275. func _Hub_GetIOVar_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  276. in := new(rpc.Request)
  277. if err := dec(in); err != nil {
  278. return nil, err
  279. }
  280. if interceptor == nil {
  281. return srv.(HubServer).GetIOVar(ctx, in)
  282. }
  283. info := &grpc.UnaryServerInfo{
  284. Server: srv,
  285. FullMethod: Hub_GetIOVar_FullMethodName,
  286. }
  287. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  288. return srv.(HubServer).GetIOVar(ctx, req.(*rpc.Request))
  289. }
  290. return interceptor(ctx, in, info, handler)
  291. }
  292. func _Hub_Ping_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  293. in := new(rpc.Request)
  294. if err := dec(in); err != nil {
  295. return nil, err
  296. }
  297. if interceptor == nil {
  298. return srv.(HubServer).Ping(ctx, in)
  299. }
  300. info := &grpc.UnaryServerInfo{
  301. Server: srv,
  302. FullMethod: Hub_Ping_FullMethodName,
  303. }
  304. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  305. return srv.(HubServer).Ping(ctx, req.(*rpc.Request))
  306. }
  307. return interceptor(ctx, in, info, handler)
  308. }
  309. func _Hub_GetState_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  310. in := new(rpc.Request)
  311. if err := dec(in); err != nil {
  312. return nil, err
  313. }
  314. if interceptor == nil {
  315. return srv.(HubServer).GetState(ctx, in)
  316. }
  317. info := &grpc.UnaryServerInfo{
  318. Server: srv,
  319. FullMethod: Hub_GetState_FullMethodName,
  320. }
  321. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  322. return srv.(HubServer).GetState(ctx, req.(*rpc.Request))
  323. }
  324. return interceptor(ctx, in, info, handler)
  325. }
  326. func _Hub_NotifyUserAccessTokenInvalid_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  327. in := new(rpc.Request)
  328. if err := dec(in); err != nil {
  329. return nil, err
  330. }
  331. if interceptor == nil {
  332. return srv.(HubServer).NotifyUserAccessTokenInvalid(ctx, in)
  333. }
  334. info := &grpc.UnaryServerInfo{
  335. Server: srv,
  336. FullMethod: Hub_NotifyUserAccessTokenInvalid_FullMethodName,
  337. }
  338. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  339. return srv.(HubServer).NotifyUserAccessTokenInvalid(ctx, req.(*rpc.Request))
  340. }
  341. return interceptor(ctx, in, info, handler)
  342. }
  343. // Hub_ServiceDesc is the grpc.ServiceDesc for Hub service.
  344. // It's only intended for direct use with grpc.RegisterService,
  345. // and not to be introspected or modified (even as a copy)
  346. var Hub_ServiceDesc = grpc.ServiceDesc{
  347. ServiceName: "hubrpc.Hub",
  348. HandlerType: (*HubServer)(nil),
  349. Methods: []grpc.MethodDesc{
  350. {
  351. MethodName: "ExecuteIOPlan",
  352. Handler: _Hub_ExecuteIOPlan_Handler,
  353. },
  354. {
  355. MethodName: "SendIOVar",
  356. Handler: _Hub_SendIOVar_Handler,
  357. },
  358. {
  359. MethodName: "GetIOVar",
  360. Handler: _Hub_GetIOVar_Handler,
  361. },
  362. {
  363. MethodName: "Ping",
  364. Handler: _Hub_Ping_Handler,
  365. },
  366. {
  367. MethodName: "GetState",
  368. Handler: _Hub_GetState_Handler,
  369. },
  370. {
  371. MethodName: "NotifyUserAccessTokenInvalid",
  372. Handler: _Hub_NotifyUserAccessTokenInvalid_Handler,
  373. },
  374. },
  375. Streams: []grpc.StreamDesc{
  376. {
  377. StreamName: "SendIOStream",
  378. Handler: _Hub_SendIOStream_Handler,
  379. ClientStreams: true,
  380. },
  381. {
  382. StreamName: "GetIOStream",
  383. Handler: _Hub_GetIOStream_Handler,
  384. ServerStreams: true,
  385. },
  386. },
  387. Metadata: "pkgs/rpc/hub/hub.proto",
  388. }

本项目旨在将云际存储公共基础设施化,使个人及企业可低门槛使用高效的云际存储服务(安装开箱即用云际存储客户端即可,无需关注其他组件的部署),同时支持用户灵活便捷定制云际存储的功能细节。