websocket_grpc.pb.go 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294
  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. FindOnlinePersonNum(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*OnlinePersonReply, error)
  30. }
  31. type websocketClient struct {
  32. cc grpc.ClientConnInterface
  33. }
  34. func NewWebsocketClient(cc grpc.ClientConnInterface) WebsocketClient {
  35. return &websocketClient{cc}
  36. }
  37. func (c *websocketClient) FindOnlinePerson(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*FindOnlinePersonReply, error) {
  38. out := new(FindOnlinePersonReply)
  39. err := c.cc.Invoke(ctx, "/api.websocket.Websocket/FindOnlinePerson", in, out, opts...)
  40. if err != nil {
  41. return nil, err
  42. }
  43. return out, nil
  44. }
  45. func (c *websocketClient) SendMsg(ctx context.Context, in *SendMsgRequest, opts ...grpc.CallOption) (*SendMsgReply, error) {
  46. out := new(SendMsgReply)
  47. err := c.cc.Invoke(ctx, "/api.websocket.Websocket/SendMsg", in, out, opts...)
  48. if err != nil {
  49. return nil, err
  50. }
  51. return out, nil
  52. }
  53. func (c *websocketClient) UpdateWorkingStatus(ctx context.Context, in *UpdateWorkingStatusRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
  54. out := new(emptypb.Empty)
  55. err := c.cc.Invoke(ctx, "/api.websocket.Websocket/UpdateWorkingStatus", in, out, opts...)
  56. if err != nil {
  57. return nil, err
  58. }
  59. return out, nil
  60. }
  61. func (c *websocketClient) UpdateWeight(ctx context.Context, in *UpdateWeightRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
  62. out := new(emptypb.Empty)
  63. err := c.cc.Invoke(ctx, "/api.websocket.Websocket/UpdateWeight", in, out, opts...)
  64. if err != nil {
  65. return nil, err
  66. }
  67. return out, nil
  68. }
  69. func (c *websocketClient) CheckIsOnline(ctx context.Context, in *CheckIsOnlineRequest, opts ...grpc.CallOption) (*CheckIsOnlineReply, error) {
  70. out := new(CheckIsOnlineReply)
  71. err := c.cc.Invoke(ctx, "/api.websocket.Websocket/CheckIsOnline", in, out, opts...)
  72. if err != nil {
  73. return nil, err
  74. }
  75. return out, nil
  76. }
  77. func (c *websocketClient) FindOnlinePersonNum(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*OnlinePersonReply, error) {
  78. out := new(OnlinePersonReply)
  79. err := c.cc.Invoke(ctx, "/api.websocket.Websocket/FindOnlinePersonNum", in, out, opts...)
  80. if err != nil {
  81. return nil, err
  82. }
  83. return out, nil
  84. }
  85. // WebsocketServer is the server API for Websocket service.
  86. // All implementations must embed UnimplementedWebsocketServer
  87. // for forward compatibility
  88. type WebsocketServer interface {
  89. // 查询在线人数
  90. FindOnlinePerson(context.Context, *emptypb.Empty) (*FindOnlinePersonReply, error)
  91. // 发送消息
  92. SendMsg(context.Context, *SendMsgRequest) (*SendMsgReply, error)
  93. // 更新工作状态
  94. UpdateWorkingStatus(context.Context, *UpdateWorkingStatusRequest) (*emptypb.Empty, error)
  95. // 更新权重
  96. UpdateWeight(context.Context, *UpdateWeightRequest) (*emptypb.Empty, error)
  97. // 检查是否在线
  98. CheckIsOnline(context.Context, *CheckIsOnlineRequest) (*CheckIsOnlineReply, error)
  99. // 查询在线多少人
  100. FindOnlinePersonNum(context.Context, *emptypb.Empty) (*OnlinePersonReply, error)
  101. mustEmbedUnimplementedWebsocketServer()
  102. }
  103. // UnimplementedWebsocketServer must be embedded to have forward compatible implementations.
  104. type UnimplementedWebsocketServer struct {
  105. }
  106. func (UnimplementedWebsocketServer) FindOnlinePerson(context.Context, *emptypb.Empty) (*FindOnlinePersonReply, error) {
  107. return nil, status.Errorf(codes.Unimplemented, "method FindOnlinePerson not implemented")
  108. }
  109. func (UnimplementedWebsocketServer) SendMsg(context.Context, *SendMsgRequest) (*SendMsgReply, error) {
  110. return nil, status.Errorf(codes.Unimplemented, "method SendMsg not implemented")
  111. }
  112. func (UnimplementedWebsocketServer) UpdateWorkingStatus(context.Context, *UpdateWorkingStatusRequest) (*emptypb.Empty, error) {
  113. return nil, status.Errorf(codes.Unimplemented, "method UpdateWorkingStatus not implemented")
  114. }
  115. func (UnimplementedWebsocketServer) UpdateWeight(context.Context, *UpdateWeightRequest) (*emptypb.Empty, error) {
  116. return nil, status.Errorf(codes.Unimplemented, "method UpdateWeight not implemented")
  117. }
  118. func (UnimplementedWebsocketServer) CheckIsOnline(context.Context, *CheckIsOnlineRequest) (*CheckIsOnlineReply, error) {
  119. return nil, status.Errorf(codes.Unimplemented, "method CheckIsOnline not implemented")
  120. }
  121. func (UnimplementedWebsocketServer) FindOnlinePersonNum(context.Context, *emptypb.Empty) (*OnlinePersonReply, error) {
  122. return nil, status.Errorf(codes.Unimplemented, "method FindOnlinePersonNum not implemented")
  123. }
  124. func (UnimplementedWebsocketServer) mustEmbedUnimplementedWebsocketServer() {}
  125. // UnsafeWebsocketServer may be embedded to opt out of forward compatibility for this service.
  126. // Use of this interface is not recommended, as added methods to WebsocketServer will
  127. // result in compilation errors.
  128. type UnsafeWebsocketServer interface {
  129. mustEmbedUnimplementedWebsocketServer()
  130. }
  131. func RegisterWebsocketServer(s grpc.ServiceRegistrar, srv WebsocketServer) {
  132. s.RegisterService(&Websocket_ServiceDesc, srv)
  133. }
  134. func _Websocket_FindOnlinePerson_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  135. in := new(emptypb.Empty)
  136. if err := dec(in); err != nil {
  137. return nil, err
  138. }
  139. if interceptor == nil {
  140. return srv.(WebsocketServer).FindOnlinePerson(ctx, in)
  141. }
  142. info := &grpc.UnaryServerInfo{
  143. Server: srv,
  144. FullMethod: "/api.websocket.Websocket/FindOnlinePerson",
  145. }
  146. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  147. return srv.(WebsocketServer).FindOnlinePerson(ctx, req.(*emptypb.Empty))
  148. }
  149. return interceptor(ctx, in, info, handler)
  150. }
  151. func _Websocket_SendMsg_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  152. in := new(SendMsgRequest)
  153. if err := dec(in); err != nil {
  154. return nil, err
  155. }
  156. if interceptor == nil {
  157. return srv.(WebsocketServer).SendMsg(ctx, in)
  158. }
  159. info := &grpc.UnaryServerInfo{
  160. Server: srv,
  161. FullMethod: "/api.websocket.Websocket/SendMsg",
  162. }
  163. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  164. return srv.(WebsocketServer).SendMsg(ctx, req.(*SendMsgRequest))
  165. }
  166. return interceptor(ctx, in, info, handler)
  167. }
  168. func _Websocket_UpdateWorkingStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  169. in := new(UpdateWorkingStatusRequest)
  170. if err := dec(in); err != nil {
  171. return nil, err
  172. }
  173. if interceptor == nil {
  174. return srv.(WebsocketServer).UpdateWorkingStatus(ctx, in)
  175. }
  176. info := &grpc.UnaryServerInfo{
  177. Server: srv,
  178. FullMethod: "/api.websocket.Websocket/UpdateWorkingStatus",
  179. }
  180. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  181. return srv.(WebsocketServer).UpdateWorkingStatus(ctx, req.(*UpdateWorkingStatusRequest))
  182. }
  183. return interceptor(ctx, in, info, handler)
  184. }
  185. func _Websocket_UpdateWeight_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  186. in := new(UpdateWeightRequest)
  187. if err := dec(in); err != nil {
  188. return nil, err
  189. }
  190. if interceptor == nil {
  191. return srv.(WebsocketServer).UpdateWeight(ctx, in)
  192. }
  193. info := &grpc.UnaryServerInfo{
  194. Server: srv,
  195. FullMethod: "/api.websocket.Websocket/UpdateWeight",
  196. }
  197. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  198. return srv.(WebsocketServer).UpdateWeight(ctx, req.(*UpdateWeightRequest))
  199. }
  200. return interceptor(ctx, in, info, handler)
  201. }
  202. func _Websocket_CheckIsOnline_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  203. in := new(CheckIsOnlineRequest)
  204. if err := dec(in); err != nil {
  205. return nil, err
  206. }
  207. if interceptor == nil {
  208. return srv.(WebsocketServer).CheckIsOnline(ctx, in)
  209. }
  210. info := &grpc.UnaryServerInfo{
  211. Server: srv,
  212. FullMethod: "/api.websocket.Websocket/CheckIsOnline",
  213. }
  214. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  215. return srv.(WebsocketServer).CheckIsOnline(ctx, req.(*CheckIsOnlineRequest))
  216. }
  217. return interceptor(ctx, in, info, handler)
  218. }
  219. func _Websocket_FindOnlinePersonNum_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  220. in := new(emptypb.Empty)
  221. if err := dec(in); err != nil {
  222. return nil, err
  223. }
  224. if interceptor == nil {
  225. return srv.(WebsocketServer).FindOnlinePersonNum(ctx, in)
  226. }
  227. info := &grpc.UnaryServerInfo{
  228. Server: srv,
  229. FullMethod: "/api.websocket.Websocket/FindOnlinePersonNum",
  230. }
  231. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  232. return srv.(WebsocketServer).FindOnlinePersonNum(ctx, req.(*emptypb.Empty))
  233. }
  234. return interceptor(ctx, in, info, handler)
  235. }
  236. // Websocket_ServiceDesc is the grpc.ServiceDesc for Websocket service.
  237. // It's only intended for direct use with grpc.RegisterService,
  238. // and not to be introspected or modified (even as a copy)
  239. var Websocket_ServiceDesc = grpc.ServiceDesc{
  240. ServiceName: "api.websocket.Websocket",
  241. HandlerType: (*WebsocketServer)(nil),
  242. Methods: []grpc.MethodDesc{
  243. {
  244. MethodName: "FindOnlinePerson",
  245. Handler: _Websocket_FindOnlinePerson_Handler,
  246. },
  247. {
  248. MethodName: "SendMsg",
  249. Handler: _Websocket_SendMsg_Handler,
  250. },
  251. {
  252. MethodName: "UpdateWorkingStatus",
  253. Handler: _Websocket_UpdateWorkingStatus_Handler,
  254. },
  255. {
  256. MethodName: "UpdateWeight",
  257. Handler: _Websocket_UpdateWeight_Handler,
  258. },
  259. {
  260. MethodName: "CheckIsOnline",
  261. Handler: _Websocket_CheckIsOnline_Handler,
  262. },
  263. {
  264. MethodName: "FindOnlinePersonNum",
  265. Handler: _Websocket_FindOnlinePersonNum_Handler,
  266. },
  267. },
  268. Streams: []grpc.StreamDesc{},
  269. Metadata: "websocket.proto",
  270. }