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.

client_grpc.pb.go 11 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293
  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/client/client.proto
  6. package clirpc
  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. Client_GetClusterMasterInfo_FullMethodName = "/clirpc.Client/GetClusterMasterInfo"
  20. Client_ClusterRaftRPC_FullMethodName = "/clirpc.Client/ClusterRaftRPC"
  21. Client_ClusterRaftInstallSnapshot_FullMethodName = "/clirpc.Client/ClusterRaftInstallSnapshot"
  22. Client_ClusterApplyLog_FullMethodName = "/clirpc.Client/ClusterApplyLog"
  23. Client_HTTPProxy_FullMethodName = "/clirpc.Client/HTTPProxy"
  24. )
  25. // ClientClient is the client API for Client 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 ClientClient interface {
  29. GetClusterMasterInfo(ctx context.Context, in *rpc.Request, opts ...grpc.CallOption) (*rpc.Response, error)
  30. ClusterRaftRPC(ctx context.Context, in *rpc.Request, opts ...grpc.CallOption) (*rpc.Response, error)
  31. ClusterRaftInstallSnapshot(ctx context.Context, opts ...grpc.CallOption) (Client_ClusterRaftInstallSnapshotClient, error)
  32. ClusterApplyLog(ctx context.Context, in *rpc.Request, opts ...grpc.CallOption) (*rpc.Response, error)
  33. HTTPProxy(ctx context.Context, in *HTTPProxyRequest, opts ...grpc.CallOption) (*HTTPProxyResponse, error)
  34. }
  35. type clientClient struct {
  36. cc grpc.ClientConnInterface
  37. }
  38. func NewClientClient(cc grpc.ClientConnInterface) ClientClient {
  39. return &clientClient{cc}
  40. }
  41. func (c *clientClient) GetClusterMasterInfo(ctx context.Context, in *rpc.Request, opts ...grpc.CallOption) (*rpc.Response, error) {
  42. out := new(rpc.Response)
  43. err := c.cc.Invoke(ctx, Client_GetClusterMasterInfo_FullMethodName, in, out, opts...)
  44. if err != nil {
  45. return nil, err
  46. }
  47. return out, nil
  48. }
  49. func (c *clientClient) ClusterRaftRPC(ctx context.Context, in *rpc.Request, opts ...grpc.CallOption) (*rpc.Response, error) {
  50. out := new(rpc.Response)
  51. err := c.cc.Invoke(ctx, Client_ClusterRaftRPC_FullMethodName, in, out, opts...)
  52. if err != nil {
  53. return nil, err
  54. }
  55. return out, nil
  56. }
  57. func (c *clientClient) ClusterRaftInstallSnapshot(ctx context.Context, opts ...grpc.CallOption) (Client_ClusterRaftInstallSnapshotClient, error) {
  58. stream, err := c.cc.NewStream(ctx, &Client_ServiceDesc.Streams[0], Client_ClusterRaftInstallSnapshot_FullMethodName, opts...)
  59. if err != nil {
  60. return nil, err
  61. }
  62. x := &clientClusterRaftInstallSnapshotClient{stream}
  63. return x, nil
  64. }
  65. type Client_ClusterRaftInstallSnapshotClient interface {
  66. Send(*rpc.ChunkedData) error
  67. CloseAndRecv() (*rpc.Response, error)
  68. grpc.ClientStream
  69. }
  70. type clientClusterRaftInstallSnapshotClient struct {
  71. grpc.ClientStream
  72. }
  73. func (x *clientClusterRaftInstallSnapshotClient) Send(m *rpc.ChunkedData) error {
  74. return x.ClientStream.SendMsg(m)
  75. }
  76. func (x *clientClusterRaftInstallSnapshotClient) CloseAndRecv() (*rpc.Response, error) {
  77. if err := x.ClientStream.CloseSend(); err != nil {
  78. return nil, err
  79. }
  80. m := new(rpc.Response)
  81. if err := x.ClientStream.RecvMsg(m); err != nil {
  82. return nil, err
  83. }
  84. return m, nil
  85. }
  86. func (c *clientClient) ClusterApplyLog(ctx context.Context, in *rpc.Request, opts ...grpc.CallOption) (*rpc.Response, error) {
  87. out := new(rpc.Response)
  88. err := c.cc.Invoke(ctx, Client_ClusterApplyLog_FullMethodName, in, out, opts...)
  89. if err != nil {
  90. return nil, err
  91. }
  92. return out, nil
  93. }
  94. func (c *clientClient) HTTPProxy(ctx context.Context, in *HTTPProxyRequest, opts ...grpc.CallOption) (*HTTPProxyResponse, error) {
  95. out := new(HTTPProxyResponse)
  96. err := c.cc.Invoke(ctx, Client_HTTPProxy_FullMethodName, in, out, opts...)
  97. if err != nil {
  98. return nil, err
  99. }
  100. return out, nil
  101. }
  102. // ClientServer is the server API for Client service.
  103. // All implementations must embed UnimplementedClientServer
  104. // for forward compatibility
  105. type ClientServer interface {
  106. GetClusterMasterInfo(context.Context, *rpc.Request) (*rpc.Response, error)
  107. ClusterRaftRPC(context.Context, *rpc.Request) (*rpc.Response, error)
  108. ClusterRaftInstallSnapshot(Client_ClusterRaftInstallSnapshotServer) error
  109. ClusterApplyLog(context.Context, *rpc.Request) (*rpc.Response, error)
  110. HTTPProxy(context.Context, *HTTPProxyRequest) (*HTTPProxyResponse, error)
  111. mustEmbedUnimplementedClientServer()
  112. }
  113. // UnimplementedClientServer must be embedded to have forward compatible implementations.
  114. type UnimplementedClientServer struct {
  115. }
  116. func (UnimplementedClientServer) GetClusterMasterInfo(context.Context, *rpc.Request) (*rpc.Response, error) {
  117. return nil, status.Errorf(codes.Unimplemented, "method GetClusterMasterInfo not implemented")
  118. }
  119. func (UnimplementedClientServer) ClusterRaftRPC(context.Context, *rpc.Request) (*rpc.Response, error) {
  120. return nil, status.Errorf(codes.Unimplemented, "method ClusterRaftRPC not implemented")
  121. }
  122. func (UnimplementedClientServer) ClusterRaftInstallSnapshot(Client_ClusterRaftInstallSnapshotServer) error {
  123. return status.Errorf(codes.Unimplemented, "method ClusterRaftInstallSnapshot not implemented")
  124. }
  125. func (UnimplementedClientServer) ClusterApplyLog(context.Context, *rpc.Request) (*rpc.Response, error) {
  126. return nil, status.Errorf(codes.Unimplemented, "method ClusterApplyLog not implemented")
  127. }
  128. func (UnimplementedClientServer) HTTPProxy(context.Context, *HTTPProxyRequest) (*HTTPProxyResponse, error) {
  129. return nil, status.Errorf(codes.Unimplemented, "method HTTPProxy not implemented")
  130. }
  131. func (UnimplementedClientServer) mustEmbedUnimplementedClientServer() {}
  132. // UnsafeClientServer may be embedded to opt out of forward compatibility for this service.
  133. // Use of this interface is not recommended, as added methods to ClientServer will
  134. // result in compilation errors.
  135. type UnsafeClientServer interface {
  136. mustEmbedUnimplementedClientServer()
  137. }
  138. func RegisterClientServer(s grpc.ServiceRegistrar, srv ClientServer) {
  139. s.RegisterService(&Client_ServiceDesc, srv)
  140. }
  141. func _Client_GetClusterMasterInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  142. in := new(rpc.Request)
  143. if err := dec(in); err != nil {
  144. return nil, err
  145. }
  146. if interceptor == nil {
  147. return srv.(ClientServer).GetClusterMasterInfo(ctx, in)
  148. }
  149. info := &grpc.UnaryServerInfo{
  150. Server: srv,
  151. FullMethod: Client_GetClusterMasterInfo_FullMethodName,
  152. }
  153. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  154. return srv.(ClientServer).GetClusterMasterInfo(ctx, req.(*rpc.Request))
  155. }
  156. return interceptor(ctx, in, info, handler)
  157. }
  158. func _Client_ClusterRaftRPC_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  159. in := new(rpc.Request)
  160. if err := dec(in); err != nil {
  161. return nil, err
  162. }
  163. if interceptor == nil {
  164. return srv.(ClientServer).ClusterRaftRPC(ctx, in)
  165. }
  166. info := &grpc.UnaryServerInfo{
  167. Server: srv,
  168. FullMethod: Client_ClusterRaftRPC_FullMethodName,
  169. }
  170. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  171. return srv.(ClientServer).ClusterRaftRPC(ctx, req.(*rpc.Request))
  172. }
  173. return interceptor(ctx, in, info, handler)
  174. }
  175. func _Client_ClusterRaftInstallSnapshot_Handler(srv interface{}, stream grpc.ServerStream) error {
  176. return srv.(ClientServer).ClusterRaftInstallSnapshot(&clientClusterRaftInstallSnapshotServer{stream})
  177. }
  178. type Client_ClusterRaftInstallSnapshotServer interface {
  179. SendAndClose(*rpc.Response) error
  180. Recv() (*rpc.ChunkedData, error)
  181. grpc.ServerStream
  182. }
  183. type clientClusterRaftInstallSnapshotServer struct {
  184. grpc.ServerStream
  185. }
  186. func (x *clientClusterRaftInstallSnapshotServer) SendAndClose(m *rpc.Response) error {
  187. return x.ServerStream.SendMsg(m)
  188. }
  189. func (x *clientClusterRaftInstallSnapshotServer) Recv() (*rpc.ChunkedData, error) {
  190. m := new(rpc.ChunkedData)
  191. if err := x.ServerStream.RecvMsg(m); err != nil {
  192. return nil, err
  193. }
  194. return m, nil
  195. }
  196. func _Client_ClusterApplyLog_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  197. in := new(rpc.Request)
  198. if err := dec(in); err != nil {
  199. return nil, err
  200. }
  201. if interceptor == nil {
  202. return srv.(ClientServer).ClusterApplyLog(ctx, in)
  203. }
  204. info := &grpc.UnaryServerInfo{
  205. Server: srv,
  206. FullMethod: Client_ClusterApplyLog_FullMethodName,
  207. }
  208. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  209. return srv.(ClientServer).ClusterApplyLog(ctx, req.(*rpc.Request))
  210. }
  211. return interceptor(ctx, in, info, handler)
  212. }
  213. func _Client_HTTPProxy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  214. in := new(HTTPProxyRequest)
  215. if err := dec(in); err != nil {
  216. return nil, err
  217. }
  218. if interceptor == nil {
  219. return srv.(ClientServer).HTTPProxy(ctx, in)
  220. }
  221. info := &grpc.UnaryServerInfo{
  222. Server: srv,
  223. FullMethod: Client_HTTPProxy_FullMethodName,
  224. }
  225. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  226. return srv.(ClientServer).HTTPProxy(ctx, req.(*HTTPProxyRequest))
  227. }
  228. return interceptor(ctx, in, info, handler)
  229. }
  230. // Client_ServiceDesc is the grpc.ServiceDesc for Client service.
  231. // It's only intended for direct use with grpc.RegisterService,
  232. // and not to be introspected or modified (even as a copy)
  233. var Client_ServiceDesc = grpc.ServiceDesc{
  234. ServiceName: "clirpc.Client",
  235. HandlerType: (*ClientServer)(nil),
  236. Methods: []grpc.MethodDesc{
  237. {
  238. MethodName: "GetClusterMasterInfo",
  239. Handler: _Client_GetClusterMasterInfo_Handler,
  240. },
  241. {
  242. MethodName: "ClusterRaftRPC",
  243. Handler: _Client_ClusterRaftRPC_Handler,
  244. },
  245. {
  246. MethodName: "ClusterApplyLog",
  247. Handler: _Client_ClusterApplyLog_Handler,
  248. },
  249. {
  250. MethodName: "HTTPProxy",
  251. Handler: _Client_HTTPProxy_Handler,
  252. },
  253. },
  254. Streams: []grpc.StreamDesc{
  255. {
  256. StreamName: "ClusterRaftInstallSnapshot",
  257. Handler: _Client_ClusterRaftInstallSnapshot_Handler,
  258. ClientStreams: true,
  259. },
  260. },
  261. Metadata: "pkgs/rpc/client/client.proto",
  262. }

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