282 lines
9.8 KiB
Go
282 lines
9.8 KiB
Go
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|
|
|
package grpc
|
|
|
|
import (
|
|
context "context"
|
|
grpc "google.golang.org/grpc"
|
|
codes "google.golang.org/grpc/codes"
|
|
status "google.golang.org/grpc/status"
|
|
)
|
|
|
|
// This is a compile-time assertion to ensure that this generated file
|
|
// is compatible with the grpc package it is being compiled against.
|
|
// Requires gRPC-Go v1.32.0 or later.
|
|
const _ = grpc.SupportPackageIsVersion7
|
|
|
|
// CometClient is the client API for Comet service.
|
|
//
|
|
// 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.
|
|
type CometClient interface {
|
|
PushMsg(ctx context.Context, in *PushMsgReq, opts ...grpc.CallOption) (*PushMsgReply, error)
|
|
Broadcast(ctx context.Context, in *BroadcastReq, opts ...grpc.CallOption) (*BroadcastReply, error)
|
|
BroadcastGroup(ctx context.Context, in *BroadcastGroupReq, opts ...grpc.CallOption) (*BroadcastGroupReply, error)
|
|
JoinGroups(ctx context.Context, in *JoinGroupsReq, opts ...grpc.CallOption) (*JoinGroupsReply, error)
|
|
LeaveGroups(ctx context.Context, in *LeaveGroupsReq, opts ...grpc.CallOption) (*LeaveGroupsReply, error)
|
|
DelGroups(ctx context.Context, in *DelGroupsReq, opts ...grpc.CallOption) (*DelGroupsReply, error)
|
|
}
|
|
|
|
type cometClient struct {
|
|
cc grpc.ClientConnInterface
|
|
}
|
|
|
|
func NewCometClient(cc grpc.ClientConnInterface) CometClient {
|
|
return &cometClient{cc}
|
|
}
|
|
|
|
func (c *cometClient) PushMsg(ctx context.Context, in *PushMsgReq, opts ...grpc.CallOption) (*PushMsgReply, error) {
|
|
out := new(PushMsgReply)
|
|
err := c.cc.Invoke(ctx, "/im.comet.Comet/PushMsg", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *cometClient) Broadcast(ctx context.Context, in *BroadcastReq, opts ...grpc.CallOption) (*BroadcastReply, error) {
|
|
out := new(BroadcastReply)
|
|
err := c.cc.Invoke(ctx, "/im.comet.Comet/Broadcast", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *cometClient) BroadcastGroup(ctx context.Context, in *BroadcastGroupReq, opts ...grpc.CallOption) (*BroadcastGroupReply, error) {
|
|
out := new(BroadcastGroupReply)
|
|
err := c.cc.Invoke(ctx, "/im.comet.Comet/BroadcastGroup", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *cometClient) JoinGroups(ctx context.Context, in *JoinGroupsReq, opts ...grpc.CallOption) (*JoinGroupsReply, error) {
|
|
out := new(JoinGroupsReply)
|
|
err := c.cc.Invoke(ctx, "/im.comet.Comet/JoinGroups", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *cometClient) LeaveGroups(ctx context.Context, in *LeaveGroupsReq, opts ...grpc.CallOption) (*LeaveGroupsReply, error) {
|
|
out := new(LeaveGroupsReply)
|
|
err := c.cc.Invoke(ctx, "/im.comet.Comet/LeaveGroups", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *cometClient) DelGroups(ctx context.Context, in *DelGroupsReq, opts ...grpc.CallOption) (*DelGroupsReply, error) {
|
|
out := new(DelGroupsReply)
|
|
err := c.cc.Invoke(ctx, "/im.comet.Comet/DelGroups", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
// CometServer is the server API for Comet service.
|
|
// All implementations must embed UnimplementedCometServer
|
|
// for forward compatibility
|
|
type CometServer interface {
|
|
PushMsg(context.Context, *PushMsgReq) (*PushMsgReply, error)
|
|
Broadcast(context.Context, *BroadcastReq) (*BroadcastReply, error)
|
|
BroadcastGroup(context.Context, *BroadcastGroupReq) (*BroadcastGroupReply, error)
|
|
JoinGroups(context.Context, *JoinGroupsReq) (*JoinGroupsReply, error)
|
|
LeaveGroups(context.Context, *LeaveGroupsReq) (*LeaveGroupsReply, error)
|
|
DelGroups(context.Context, *DelGroupsReq) (*DelGroupsReply, error)
|
|
mustEmbedUnimplementedCometServer()
|
|
}
|
|
|
|
// UnimplementedCometServer must be embedded to have forward compatible implementations.
|
|
type UnimplementedCometServer struct {
|
|
}
|
|
|
|
func (UnimplementedCometServer) PushMsg(context.Context, *PushMsgReq) (*PushMsgReply, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method PushMsg not implemented")
|
|
}
|
|
func (UnimplementedCometServer) Broadcast(context.Context, *BroadcastReq) (*BroadcastReply, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method Broadcast not implemented")
|
|
}
|
|
func (UnimplementedCometServer) BroadcastGroup(context.Context, *BroadcastGroupReq) (*BroadcastGroupReply, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method BroadcastGroup not implemented")
|
|
}
|
|
func (UnimplementedCometServer) JoinGroups(context.Context, *JoinGroupsReq) (*JoinGroupsReply, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method JoinGroups not implemented")
|
|
}
|
|
func (UnimplementedCometServer) LeaveGroups(context.Context, *LeaveGroupsReq) (*LeaveGroupsReply, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method LeaveGroups not implemented")
|
|
}
|
|
func (UnimplementedCometServer) DelGroups(context.Context, *DelGroupsReq) (*DelGroupsReply, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method DelGroups not implemented")
|
|
}
|
|
func (UnimplementedCometServer) mustEmbedUnimplementedCometServer() {}
|
|
|
|
// UnsafeCometServer may be embedded to opt out of forward compatibility for this service.
|
|
// Use of this interface is not recommended, as added methods to CometServer will
|
|
// result in compilation errors.
|
|
type UnsafeCometServer interface {
|
|
mustEmbedUnimplementedCometServer()
|
|
}
|
|
|
|
func RegisterCometServer(s grpc.ServiceRegistrar, srv CometServer) {
|
|
s.RegisterService(&Comet_ServiceDesc, srv)
|
|
}
|
|
|
|
func _Comet_PushMsg_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(PushMsgReq)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(CometServer).PushMsg(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/im.comet.Comet/PushMsg",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(CometServer).PushMsg(ctx, req.(*PushMsgReq))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _Comet_Broadcast_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(BroadcastReq)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(CometServer).Broadcast(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/im.comet.Comet/Broadcast",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(CometServer).Broadcast(ctx, req.(*BroadcastReq))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _Comet_BroadcastGroup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(BroadcastGroupReq)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(CometServer).BroadcastGroup(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/im.comet.Comet/BroadcastGroup",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(CometServer).BroadcastGroup(ctx, req.(*BroadcastGroupReq))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _Comet_JoinGroups_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(JoinGroupsReq)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(CometServer).JoinGroups(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/im.comet.Comet/JoinGroups",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(CometServer).JoinGroups(ctx, req.(*JoinGroupsReq))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _Comet_LeaveGroups_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(LeaveGroupsReq)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(CometServer).LeaveGroups(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/im.comet.Comet/LeaveGroups",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(CometServer).LeaveGroups(ctx, req.(*LeaveGroupsReq))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _Comet_DelGroups_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(DelGroupsReq)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(CometServer).DelGroups(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/im.comet.Comet/DelGroups",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(CometServer).DelGroups(ctx, req.(*DelGroupsReq))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
// Comet_ServiceDesc is the grpc.ServiceDesc for Comet service.
|
|
// It's only intended for direct use with grpc.RegisterService,
|
|
// and not to be introspected or modified (even as a copy)
|
|
var Comet_ServiceDesc = grpc.ServiceDesc{
|
|
ServiceName: "im.comet.Comet",
|
|
HandlerType: (*CometServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "PushMsg",
|
|
Handler: _Comet_PushMsg_Handler,
|
|
},
|
|
{
|
|
MethodName: "Broadcast",
|
|
Handler: _Comet_Broadcast_Handler,
|
|
},
|
|
{
|
|
MethodName: "BroadcastGroup",
|
|
Handler: _Comet_BroadcastGroup_Handler,
|
|
},
|
|
{
|
|
MethodName: "JoinGroups",
|
|
Handler: _Comet_JoinGroups_Handler,
|
|
},
|
|
{
|
|
MethodName: "LeaveGroups",
|
|
Handler: _Comet_LeaveGroups_Handler,
|
|
},
|
|
{
|
|
MethodName: "DelGroups",
|
|
Handler: _Comet_DelGroups_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{},
|
|
Metadata: "comet.proto",
|
|
}
|