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.

agent_grpc.pb.go 11 kB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382
  1. // 使用的语法版本
  2. // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
  3. // versions:
  4. // - protoc-gen-go-grpc v1.3.0
  5. // - protoc v4.22.3
  6. // source: pkgs/grpc/agent/agent.proto
  7. package agent
  8. import (
  9. context "context"
  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. Agent_SendIPFSFile_FullMethodName = "/Agent/SendIPFSFile"
  20. Agent_GetIPFSFile_FullMethodName = "/Agent/GetIPFSFile"
  21. Agent_SendStream_FullMethodName = "/Agent/SendStream"
  22. Agent_FetchStream_FullMethodName = "/Agent/FetchStream"
  23. Agent_Ping_FullMethodName = "/Agent/Ping"
  24. )
  25. // AgentClient is the client API for Agent service.
  26. //
  27. // 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.
  28. type AgentClient interface {
  29. SendIPFSFile(ctx context.Context, opts ...grpc.CallOption) (Agent_SendIPFSFileClient, error)
  30. GetIPFSFile(ctx context.Context, in *GetIPFSFileReq, opts ...grpc.CallOption) (Agent_GetIPFSFileClient, error)
  31. SendStream(ctx context.Context, opts ...grpc.CallOption) (Agent_SendStreamClient, error)
  32. FetchStream(ctx context.Context, in *FetchStreamReq, opts ...grpc.CallOption) (Agent_FetchStreamClient, error)
  33. Ping(ctx context.Context, in *PingReq, opts ...grpc.CallOption) (*PingResp, error)
  34. }
  35. type agentClient struct {
  36. cc grpc.ClientConnInterface
  37. }
  38. func NewAgentClient(cc grpc.ClientConnInterface) AgentClient {
  39. return &agentClient{cc}
  40. }
  41. func (c *agentClient) SendIPFSFile(ctx context.Context, opts ...grpc.CallOption) (Agent_SendIPFSFileClient, error) {
  42. stream, err := c.cc.NewStream(ctx, &Agent_ServiceDesc.Streams[0], Agent_SendIPFSFile_FullMethodName, opts...)
  43. if err != nil {
  44. return nil, err
  45. }
  46. x := &agentSendIPFSFileClient{stream}
  47. return x, nil
  48. }
  49. type Agent_SendIPFSFileClient interface {
  50. Send(*FileDataPacket) error
  51. CloseAndRecv() (*SendIPFSFileResp, error)
  52. grpc.ClientStream
  53. }
  54. type agentSendIPFSFileClient struct {
  55. grpc.ClientStream
  56. }
  57. func (x *agentSendIPFSFileClient) Send(m *FileDataPacket) error {
  58. return x.ClientStream.SendMsg(m)
  59. }
  60. func (x *agentSendIPFSFileClient) CloseAndRecv() (*SendIPFSFileResp, error) {
  61. if err := x.ClientStream.CloseSend(); err != nil {
  62. return nil, err
  63. }
  64. m := new(SendIPFSFileResp)
  65. if err := x.ClientStream.RecvMsg(m); err != nil {
  66. return nil, err
  67. }
  68. return m, nil
  69. }
  70. func (c *agentClient) GetIPFSFile(ctx context.Context, in *GetIPFSFileReq, opts ...grpc.CallOption) (Agent_GetIPFSFileClient, error) {
  71. stream, err := c.cc.NewStream(ctx, &Agent_ServiceDesc.Streams[1], Agent_GetIPFSFile_FullMethodName, opts...)
  72. if err != nil {
  73. return nil, err
  74. }
  75. x := &agentGetIPFSFileClient{stream}
  76. if err := x.ClientStream.SendMsg(in); err != nil {
  77. return nil, err
  78. }
  79. if err := x.ClientStream.CloseSend(); err != nil {
  80. return nil, err
  81. }
  82. return x, nil
  83. }
  84. type Agent_GetIPFSFileClient interface {
  85. Recv() (*FileDataPacket, error)
  86. grpc.ClientStream
  87. }
  88. type agentGetIPFSFileClient struct {
  89. grpc.ClientStream
  90. }
  91. func (x *agentGetIPFSFileClient) Recv() (*FileDataPacket, error) {
  92. m := new(FileDataPacket)
  93. if err := x.ClientStream.RecvMsg(m); err != nil {
  94. return nil, err
  95. }
  96. return m, nil
  97. }
  98. func (c *agentClient) SendStream(ctx context.Context, opts ...grpc.CallOption) (Agent_SendStreamClient, error) {
  99. stream, err := c.cc.NewStream(ctx, &Agent_ServiceDesc.Streams[2], Agent_SendStream_FullMethodName, opts...)
  100. if err != nil {
  101. return nil, err
  102. }
  103. x := &agentSendStreamClient{stream}
  104. return x, nil
  105. }
  106. type Agent_SendStreamClient interface {
  107. Send(*StreamDataPacket) error
  108. CloseAndRecv() (*SendStreamResp, error)
  109. grpc.ClientStream
  110. }
  111. type agentSendStreamClient struct {
  112. grpc.ClientStream
  113. }
  114. func (x *agentSendStreamClient) Send(m *StreamDataPacket) error {
  115. return x.ClientStream.SendMsg(m)
  116. }
  117. func (x *agentSendStreamClient) CloseAndRecv() (*SendStreamResp, error) {
  118. if err := x.ClientStream.CloseSend(); err != nil {
  119. return nil, err
  120. }
  121. m := new(SendStreamResp)
  122. if err := x.ClientStream.RecvMsg(m); err != nil {
  123. return nil, err
  124. }
  125. return m, nil
  126. }
  127. func (c *agentClient) FetchStream(ctx context.Context, in *FetchStreamReq, opts ...grpc.CallOption) (Agent_FetchStreamClient, error) {
  128. stream, err := c.cc.NewStream(ctx, &Agent_ServiceDesc.Streams[3], Agent_FetchStream_FullMethodName, opts...)
  129. if err != nil {
  130. return nil, err
  131. }
  132. x := &agentFetchStreamClient{stream}
  133. if err := x.ClientStream.SendMsg(in); err != nil {
  134. return nil, err
  135. }
  136. if err := x.ClientStream.CloseSend(); err != nil {
  137. return nil, err
  138. }
  139. return x, nil
  140. }
  141. type Agent_FetchStreamClient interface {
  142. Recv() (*StreamDataPacket, error)
  143. grpc.ClientStream
  144. }
  145. type agentFetchStreamClient struct {
  146. grpc.ClientStream
  147. }
  148. func (x *agentFetchStreamClient) Recv() (*StreamDataPacket, error) {
  149. m := new(StreamDataPacket)
  150. if err := x.ClientStream.RecvMsg(m); err != nil {
  151. return nil, err
  152. }
  153. return m, nil
  154. }
  155. func (c *agentClient) Ping(ctx context.Context, in *PingReq, opts ...grpc.CallOption) (*PingResp, error) {
  156. out := new(PingResp)
  157. err := c.cc.Invoke(ctx, Agent_Ping_FullMethodName, in, out, opts...)
  158. if err != nil {
  159. return nil, err
  160. }
  161. return out, nil
  162. }
  163. // AgentServer is the server API for Agent service.
  164. // All implementations must embed UnimplementedAgentServer
  165. // for forward compatibility
  166. type AgentServer interface {
  167. SendIPFSFile(Agent_SendIPFSFileServer) error
  168. GetIPFSFile(*GetIPFSFileReq, Agent_GetIPFSFileServer) error
  169. SendStream(Agent_SendStreamServer) error
  170. FetchStream(*FetchStreamReq, Agent_FetchStreamServer) error
  171. Ping(context.Context, *PingReq) (*PingResp, error)
  172. mustEmbedUnimplementedAgentServer()
  173. }
  174. // UnimplementedAgentServer must be embedded to have forward compatible implementations.
  175. type UnimplementedAgentServer struct {
  176. }
  177. func (UnimplementedAgentServer) SendIPFSFile(Agent_SendIPFSFileServer) error {
  178. return status.Errorf(codes.Unimplemented, "method SendIPFSFile not implemented")
  179. }
  180. func (UnimplementedAgentServer) GetIPFSFile(*GetIPFSFileReq, Agent_GetIPFSFileServer) error {
  181. return status.Errorf(codes.Unimplemented, "method GetIPFSFile not implemented")
  182. }
  183. func (UnimplementedAgentServer) SendStream(Agent_SendStreamServer) error {
  184. return status.Errorf(codes.Unimplemented, "method SendStream not implemented")
  185. }
  186. func (UnimplementedAgentServer) FetchStream(*FetchStreamReq, Agent_FetchStreamServer) error {
  187. return status.Errorf(codes.Unimplemented, "method FetchStream not implemented")
  188. }
  189. func (UnimplementedAgentServer) Ping(context.Context, *PingReq) (*PingResp, error) {
  190. return nil, status.Errorf(codes.Unimplemented, "method Ping not implemented")
  191. }
  192. func (UnimplementedAgentServer) mustEmbedUnimplementedAgentServer() {}
  193. // UnsafeAgentServer may be embedded to opt out of forward compatibility for this service.
  194. // Use of this interface is not recommended, as added methods to AgentServer will
  195. // result in compilation errors.
  196. type UnsafeAgentServer interface {
  197. mustEmbedUnimplementedAgentServer()
  198. }
  199. func RegisterAgentServer(s grpc.ServiceRegistrar, srv AgentServer) {
  200. s.RegisterService(&Agent_ServiceDesc, srv)
  201. }
  202. func _Agent_SendIPFSFile_Handler(srv interface{}, stream grpc.ServerStream) error {
  203. return srv.(AgentServer).SendIPFSFile(&agentSendIPFSFileServer{stream})
  204. }
  205. type Agent_SendIPFSFileServer interface {
  206. SendAndClose(*SendIPFSFileResp) error
  207. Recv() (*FileDataPacket, error)
  208. grpc.ServerStream
  209. }
  210. type agentSendIPFSFileServer struct {
  211. grpc.ServerStream
  212. }
  213. func (x *agentSendIPFSFileServer) SendAndClose(m *SendIPFSFileResp) error {
  214. return x.ServerStream.SendMsg(m)
  215. }
  216. func (x *agentSendIPFSFileServer) Recv() (*FileDataPacket, error) {
  217. m := new(FileDataPacket)
  218. if err := x.ServerStream.RecvMsg(m); err != nil {
  219. return nil, err
  220. }
  221. return m, nil
  222. }
  223. func _Agent_GetIPFSFile_Handler(srv interface{}, stream grpc.ServerStream) error {
  224. m := new(GetIPFSFileReq)
  225. if err := stream.RecvMsg(m); err != nil {
  226. return err
  227. }
  228. return srv.(AgentServer).GetIPFSFile(m, &agentGetIPFSFileServer{stream})
  229. }
  230. type Agent_GetIPFSFileServer interface {
  231. Send(*FileDataPacket) error
  232. grpc.ServerStream
  233. }
  234. type agentGetIPFSFileServer struct {
  235. grpc.ServerStream
  236. }
  237. func (x *agentGetIPFSFileServer) Send(m *FileDataPacket) error {
  238. return x.ServerStream.SendMsg(m)
  239. }
  240. func _Agent_SendStream_Handler(srv interface{}, stream grpc.ServerStream) error {
  241. return srv.(AgentServer).SendStream(&agentSendStreamServer{stream})
  242. }
  243. type Agent_SendStreamServer interface {
  244. SendAndClose(*SendStreamResp) error
  245. Recv() (*StreamDataPacket, error)
  246. grpc.ServerStream
  247. }
  248. type agentSendStreamServer struct {
  249. grpc.ServerStream
  250. }
  251. func (x *agentSendStreamServer) SendAndClose(m *SendStreamResp) error {
  252. return x.ServerStream.SendMsg(m)
  253. }
  254. func (x *agentSendStreamServer) Recv() (*StreamDataPacket, error) {
  255. m := new(StreamDataPacket)
  256. if err := x.ServerStream.RecvMsg(m); err != nil {
  257. return nil, err
  258. }
  259. return m, nil
  260. }
  261. func _Agent_FetchStream_Handler(srv interface{}, stream grpc.ServerStream) error {
  262. m := new(FetchStreamReq)
  263. if err := stream.RecvMsg(m); err != nil {
  264. return err
  265. }
  266. return srv.(AgentServer).FetchStream(m, &agentFetchStreamServer{stream})
  267. }
  268. type Agent_FetchStreamServer interface {
  269. Send(*StreamDataPacket) error
  270. grpc.ServerStream
  271. }
  272. type agentFetchStreamServer struct {
  273. grpc.ServerStream
  274. }
  275. func (x *agentFetchStreamServer) Send(m *StreamDataPacket) error {
  276. return x.ServerStream.SendMsg(m)
  277. }
  278. func _Agent_Ping_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  279. in := new(PingReq)
  280. if err := dec(in); err != nil {
  281. return nil, err
  282. }
  283. if interceptor == nil {
  284. return srv.(AgentServer).Ping(ctx, in)
  285. }
  286. info := &grpc.UnaryServerInfo{
  287. Server: srv,
  288. FullMethod: Agent_Ping_FullMethodName,
  289. }
  290. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  291. return srv.(AgentServer).Ping(ctx, req.(*PingReq))
  292. }
  293. return interceptor(ctx, in, info, handler)
  294. }
  295. // Agent_ServiceDesc is the grpc.ServiceDesc for Agent service.
  296. // It's only intended for direct use with grpc.RegisterService,
  297. // and not to be introspected or modified (even as a copy)
  298. var Agent_ServiceDesc = grpc.ServiceDesc{
  299. ServiceName: "Agent",
  300. HandlerType: (*AgentServer)(nil),
  301. Methods: []grpc.MethodDesc{
  302. {
  303. MethodName: "Ping",
  304. Handler: _Agent_Ping_Handler,
  305. },
  306. },
  307. Streams: []grpc.StreamDesc{
  308. {
  309. StreamName: "SendIPFSFile",
  310. Handler: _Agent_SendIPFSFile_Handler,
  311. ClientStreams: true,
  312. },
  313. {
  314. StreamName: "GetIPFSFile",
  315. Handler: _Agent_GetIPFSFile_Handler,
  316. ServerStreams: true,
  317. },
  318. {
  319. StreamName: "SendStream",
  320. Handler: _Agent_SendStream_Handler,
  321. ClientStreams: true,
  322. },
  323. {
  324. StreamName: "FetchStream",
  325. Handler: _Agent_FetchStream_Handler,
  326. ServerStreams: true,
  327. },
  328. },
  329. Metadata: "pkgs/grpc/agent/agent.proto",
  330. }

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