websocket_grpc.pb.go 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332
  1. // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
  2. package websocket
  3. import (
  4. context "context"
  5. grpc "google.golang.org/grpc"
  6. codes "google.golang.org/grpc/codes"
  7. status "google.golang.org/grpc/status"
  8. emptypb "google.golang.org/protobuf/types/known/emptypb"
  9. )
  10. // This is a compile-time assertion to ensure that this generated file
  11. // is compatible with the grpc package it is being compiled against.
  12. // Requires gRPC-Go v1.32.0 or later.
  13. const _ = grpc.SupportPackageIsVersion7
  14. // WebsocketClient is the client API for Websocket service.
  15. //
  16. // 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.
  17. type WebsocketClient interface {
  18. // 查询在线人数
  19. FindOnlinePerson(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*FindOnlinePersonReply, error)
  20. // 发送消息
  21. SendMsg(ctx context.Context, in *SendMsgRequest, opts ...grpc.CallOption) (*SendMsgReply, error)
  22. // 更新工作状态
  23. UpdateWorkingStatus(ctx context.Context, in *UpdateWorkingStatusRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
  24. // 更新权重
  25. UpdateWeight(ctx context.Context, in *UpdateWeightRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
  26. // 检查是否在线
  27. CheckIsOnline(ctx context.Context, in *CheckIsOnlineRequest, opts ...grpc.CallOption) (*CheckIsOnlineReply, error)
  28. // 检查是否在线
  29. CheckIsOnlineByIDs(ctx context.Context, in *CheckIsOnlineByIDsParam, opts ...grpc.CallOption) (*CheckIsOnlineByIDsParam, error)
  30. // 查询在线多少人
  31. FindOnlinePersonNum(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*OnlinePersonReply, error)
  32. }
  33. type websocketClient struct {
  34. cc grpc.ClientConnInterface
  35. }
  36. func NewWebsocketClient(cc grpc.ClientConnInterface) WebsocketClient {
  37. return &websocketClient{cc}
  38. }
  39. func (c *websocketClient) FindOnlinePerson(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*FindOnlinePersonReply, error) {
  40. out := new(FindOnlinePersonReply)
  41. err := c.cc.Invoke(ctx, "/api.websocket.Websocket/FindOnlinePerson", in, out, opts...)
  42. if err != nil {
  43. return nil, err
  44. }
  45. return out, nil
  46. }
  47. func (c *websocketClient) SendMsg(ctx context.Context, in *SendMsgRequest, opts ...grpc.CallOption) (*SendMsgReply, error) {
  48. out := new(SendMsgReply)
  49. err := c.cc.Invoke(ctx, "/api.websocket.Websocket/SendMsg", in, out, opts...)
  50. if err != nil {
  51. return nil, err
  52. }
  53. return out, nil
  54. }
  55. func (c *websocketClient) UpdateWorkingStatus(ctx context.Context, in *UpdateWorkingStatusRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
  56. out := new(emptypb.Empty)
  57. err := c.cc.Invoke(ctx, "/api.websocket.Websocket/UpdateWorkingStatus", in, out, opts...)
  58. if err != nil {
  59. return nil, err
  60. }
  61. return out, nil
  62. }
  63. func (c *websocketClient) UpdateWeight(ctx context.Context, in *UpdateWeightRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
  64. out := new(emptypb.Empty)
  65. err := c.cc.Invoke(ctx, "/api.websocket.Websocket/UpdateWeight", in, out, opts...)
  66. if err != nil {
  67. return nil, err
  68. }
  69. return out, nil
  70. }
  71. func (c *websocketClient) CheckIsOnline(ctx context.Context, in *CheckIsOnlineRequest, opts ...grpc.CallOption) (*CheckIsOnlineReply, error) {
  72. out := new(CheckIsOnlineReply)
  73. err := c.cc.Invoke(ctx, "/api.websocket.Websocket/CheckIsOnline", in, out, opts...)
  74. if err != nil {
  75. return nil, err
  76. }
  77. return out, nil
  78. }
  79. func (c *websocketClient) CheckIsOnlineByIDs(ctx context.Context, in *CheckIsOnlineByIDsParam, opts ...grpc.CallOption) (*CheckIsOnlineByIDsParam, error) {
  80. out := new(CheckIsOnlineByIDsParam)
  81. err := c.cc.Invoke(ctx, "/api.websocket.Websocket/CheckIsOnlineByIDs", in, out, opts...)
  82. if err != nil {
  83. return nil, err
  84. }
  85. return out, nil
  86. }
  87. func (c *websocketClient) FindOnlinePersonNum(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*OnlinePersonReply, error) {
  88. out := new(OnlinePersonReply)
  89. err := c.cc.Invoke(ctx, "/api.websocket.Websocket/FindOnlinePersonNum", in, out, opts...)
  90. if err != nil {
  91. return nil, err
  92. }
  93. return out, nil
  94. }
  95. // WebsocketServer is the server API for Websocket service.
  96. // All implementations must embed UnimplementedWebsocketServer
  97. // for forward compatibility
  98. type WebsocketServer interface {
  99. // 查询在线人数
  100. FindOnlinePerson(context.Context, *emptypb.Empty) (*FindOnlinePersonReply, error)
  101. // 发送消息
  102. SendMsg(context.Context, *SendMsgRequest) (*SendMsgReply, error)
  103. // 更新工作状态
  104. UpdateWorkingStatus(context.Context, *UpdateWorkingStatusRequest) (*emptypb.Empty, error)
  105. // 更新权重
  106. UpdateWeight(context.Context, *UpdateWeightRequest) (*emptypb.Empty, error)
  107. // 检查是否在线
  108. CheckIsOnline(context.Context, *CheckIsOnlineRequest) (*CheckIsOnlineReply, error)
  109. // 检查是否在线
  110. CheckIsOnlineByIDs(context.Context, *CheckIsOnlineByIDsParam) (*CheckIsOnlineByIDsParam, error)
  111. // 查询在线多少人
  112. FindOnlinePersonNum(context.Context, *emptypb.Empty) (*OnlinePersonReply, error)
  113. mustEmbedUnimplementedWebsocketServer()
  114. }
  115. // UnimplementedWebsocketServer must be embedded to have forward compatible implementations.
  116. type UnimplementedWebsocketServer struct {
  117. }
  118. func (UnimplementedWebsocketServer) FindOnlinePerson(context.Context, *emptypb.Empty) (*FindOnlinePersonReply, error) {
  119. return nil, status.Errorf(codes.Unimplemented, "method FindOnlinePerson not implemented")
  120. }
  121. func (UnimplementedWebsocketServer) SendMsg(context.Context, *SendMsgRequest) (*SendMsgReply, error) {
  122. return nil, status.Errorf(codes.Unimplemented, "method SendMsg not implemented")
  123. }
  124. func (UnimplementedWebsocketServer) UpdateWorkingStatus(context.Context, *UpdateWorkingStatusRequest) (*emptypb.Empty, error) {
  125. return nil, status.Errorf(codes.Unimplemented, "method UpdateWorkingStatus not implemented")
  126. }
  127. func (UnimplementedWebsocketServer) UpdateWeight(context.Context, *UpdateWeightRequest) (*emptypb.Empty, error) {
  128. return nil, status.Errorf(codes.Unimplemented, "method UpdateWeight not implemented")
  129. }
  130. func (UnimplementedWebsocketServer) CheckIsOnline(context.Context, *CheckIsOnlineRequest) (*CheckIsOnlineReply, error) {
  131. return nil, status.Errorf(codes.Unimplemented, "method CheckIsOnline not implemented")
  132. }
  133. func (UnimplementedWebsocketServer) CheckIsOnlineByIDs(context.Context, *CheckIsOnlineByIDsParam) (*CheckIsOnlineByIDsParam, error) {
  134. return nil, status.Errorf(codes.Unimplemented, "method CheckIsOnlineByIDs not implemented")
  135. }
  136. func (UnimplementedWebsocketServer) FindOnlinePersonNum(context.Context, *emptypb.Empty) (*OnlinePersonReply, error) {
  137. return nil, status.Errorf(codes.Unimplemented, "method FindOnlinePersonNum not implemented")
  138. }
  139. func (UnimplementedWebsocketServer) mustEmbedUnimplementedWebsocketServer() {}
  140. // UnsafeWebsocketServer may be embedded to opt out of forward compatibility for this service.
  141. // Use of this interface is not recommended, as added methods to WebsocketServer will
  142. // result in compilation errors.
  143. type UnsafeWebsocketServer interface {
  144. mustEmbedUnimplementedWebsocketServer()
  145. }
  146. func RegisterWebsocketServer(s grpc.ServiceRegistrar, srv WebsocketServer) {
  147. s.RegisterService(&Websocket_ServiceDesc, srv)
  148. }
  149. func _Websocket_FindOnlinePerson_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  150. in := new(emptypb.Empty)
  151. if err := dec(in); err != nil {
  152. return nil, err
  153. }
  154. if interceptor == nil {
  155. return srv.(WebsocketServer).FindOnlinePerson(ctx, in)
  156. }
  157. info := &grpc.UnaryServerInfo{
  158. Server: srv,
  159. FullMethod: "/api.websocket.Websocket/FindOnlinePerson",
  160. }
  161. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  162. return srv.(WebsocketServer).FindOnlinePerson(ctx, req.(*emptypb.Empty))
  163. }
  164. return interceptor(ctx, in, info, handler)
  165. }
  166. func _Websocket_SendMsg_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  167. in := new(SendMsgRequest)
  168. if err := dec(in); err != nil {
  169. return nil, err
  170. }
  171. if interceptor == nil {
  172. return srv.(WebsocketServer).SendMsg(ctx, in)
  173. }
  174. info := &grpc.UnaryServerInfo{
  175. Server: srv,
  176. FullMethod: "/api.websocket.Websocket/SendMsg",
  177. }
  178. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  179. return srv.(WebsocketServer).SendMsg(ctx, req.(*SendMsgRequest))
  180. }
  181. return interceptor(ctx, in, info, handler)
  182. }
  183. func _Websocket_UpdateWorkingStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  184. in := new(UpdateWorkingStatusRequest)
  185. if err := dec(in); err != nil {
  186. return nil, err
  187. }
  188. if interceptor == nil {
  189. return srv.(WebsocketServer).UpdateWorkingStatus(ctx, in)
  190. }
  191. info := &grpc.UnaryServerInfo{
  192. Server: srv,
  193. FullMethod: "/api.websocket.Websocket/UpdateWorkingStatus",
  194. }
  195. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  196. return srv.(WebsocketServer).UpdateWorkingStatus(ctx, req.(*UpdateWorkingStatusRequest))
  197. }
  198. return interceptor(ctx, in, info, handler)
  199. }
  200. func _Websocket_UpdateWeight_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  201. in := new(UpdateWeightRequest)
  202. if err := dec(in); err != nil {
  203. return nil, err
  204. }
  205. if interceptor == nil {
  206. return srv.(WebsocketServer).UpdateWeight(ctx, in)
  207. }
  208. info := &grpc.UnaryServerInfo{
  209. Server: srv,
  210. FullMethod: "/api.websocket.Websocket/UpdateWeight",
  211. }
  212. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  213. return srv.(WebsocketServer).UpdateWeight(ctx, req.(*UpdateWeightRequest))
  214. }
  215. return interceptor(ctx, in, info, handler)
  216. }
  217. func _Websocket_CheckIsOnline_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  218. in := new(CheckIsOnlineRequest)
  219. if err := dec(in); err != nil {
  220. return nil, err
  221. }
  222. if interceptor == nil {
  223. return srv.(WebsocketServer).CheckIsOnline(ctx, in)
  224. }
  225. info := &grpc.UnaryServerInfo{
  226. Server: srv,
  227. FullMethod: "/api.websocket.Websocket/CheckIsOnline",
  228. }
  229. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  230. return srv.(WebsocketServer).CheckIsOnline(ctx, req.(*CheckIsOnlineRequest))
  231. }
  232. return interceptor(ctx, in, info, handler)
  233. }
  234. func _Websocket_CheckIsOnlineByIDs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  235. in := new(CheckIsOnlineByIDsParam)
  236. if err := dec(in); err != nil {
  237. return nil, err
  238. }
  239. if interceptor == nil {
  240. return srv.(WebsocketServer).CheckIsOnlineByIDs(ctx, in)
  241. }
  242. info := &grpc.UnaryServerInfo{
  243. Server: srv,
  244. FullMethod: "/api.websocket.Websocket/CheckIsOnlineByIDs",
  245. }
  246. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  247. return srv.(WebsocketServer).CheckIsOnlineByIDs(ctx, req.(*CheckIsOnlineByIDsParam))
  248. }
  249. return interceptor(ctx, in, info, handler)
  250. }
  251. func _Websocket_FindOnlinePersonNum_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  252. in := new(emptypb.Empty)
  253. if err := dec(in); err != nil {
  254. return nil, err
  255. }
  256. if interceptor == nil {
  257. return srv.(WebsocketServer).FindOnlinePersonNum(ctx, in)
  258. }
  259. info := &grpc.UnaryServerInfo{
  260. Server: srv,
  261. FullMethod: "/api.websocket.Websocket/FindOnlinePersonNum",
  262. }
  263. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  264. return srv.(WebsocketServer).FindOnlinePersonNum(ctx, req.(*emptypb.Empty))
  265. }
  266. return interceptor(ctx, in, info, handler)
  267. }
  268. // Websocket_ServiceDesc is the grpc.ServiceDesc for Websocket service.
  269. // It's only intended for direct use with grpc.RegisterService,
  270. // and not to be introspected or modified (even as a copy)
  271. var Websocket_ServiceDesc = grpc.ServiceDesc{
  272. ServiceName: "api.websocket.Websocket",
  273. HandlerType: (*WebsocketServer)(nil),
  274. Methods: []grpc.MethodDesc{
  275. {
  276. MethodName: "FindOnlinePerson",
  277. Handler: _Websocket_FindOnlinePerson_Handler,
  278. },
  279. {
  280. MethodName: "SendMsg",
  281. Handler: _Websocket_SendMsg_Handler,
  282. },
  283. {
  284. MethodName: "UpdateWorkingStatus",
  285. Handler: _Websocket_UpdateWorkingStatus_Handler,
  286. },
  287. {
  288. MethodName: "UpdateWeight",
  289. Handler: _Websocket_UpdateWeight_Handler,
  290. },
  291. {
  292. MethodName: "CheckIsOnline",
  293. Handler: _Websocket_CheckIsOnline_Handler,
  294. },
  295. {
  296. MethodName: "CheckIsOnlineByIDs",
  297. Handler: _Websocket_CheckIsOnlineByIDs_Handler,
  298. },
  299. {
  300. MethodName: "FindOnlinePersonNum",
  301. Handler: _Websocket_FindOnlinePersonNum_Handler,
  302. },
  303. },
  304. Streams: []grpc.StreamDesc{},
  305. Metadata: "websocket.proto",
  306. }