Documentation ¶
Index ¶
- Variables
- func RegisterCometServer(s grpc.ServiceRegistrar, srv CometServer)
- func RegisterLogicServer(s grpc.ServiceRegistrar, srv LogicServer)
- type Backoff
- func (*Backoff) Descriptor() ([]byte, []int)deprecated
- func (x *Backoff) GetBaseDelay() int32
- func (x *Backoff) GetJitter() float32
- func (x *Backoff) GetMaxDelay() int32
- func (x *Backoff) GetMultiplier() float32
- func (*Backoff) ProtoMessage()
- func (x *Backoff) ProtoReflect() protoreflect.Message
- func (x *Backoff) Reset()
- func (x *Backoff) String() string
- type CometClient
- type CometServer
- type ConnectCommon
- func (*ConnectCommon) Descriptor() ([]byte, []int)deprecated
- func (x *ConnectCommon) GetServerId() string
- func (x *ConnectCommon) GetTcpSessionId() string
- func (x *ConnectCommon) GetUserId() uint64
- func (*ConnectCommon) ProtoMessage()
- func (x *ConnectCommon) ProtoReflect() protoreflect.Message
- func (x *ConnectCommon) Reset()
- func (x *ConnectCommon) String() string
- type ConnectReply
- type ConnectReq
- func (*ConnectReq) Descriptor() ([]byte, []int)deprecated
- func (x *ConnectReq) GetComm() *ConnectCommon
- func (x *ConnectReq) GetPlatform() Platform
- func (x *ConnectReq) GetRoomId() string
- func (x *ConnectReq) GetToken() string
- func (*ConnectReq) ProtoMessage()
- func (x *ConnectReq) ProtoReflect() protoreflect.Message
- func (x *ConnectReq) Reset()
- func (x *ConnectReq) String() string
- type DisconnectReply
- type DisconnectReq
- type GetAllRoomIdReply
- func (*GetAllRoomIdReply) Descriptor() ([]byte, []int)deprecated
- func (x *GetAllRoomIdReply) GetRooms() map[string]bool
- func (*GetAllRoomIdReply) ProtoMessage()
- func (x *GetAllRoomIdReply) ProtoReflect() protoreflect.Message
- func (x *GetAllRoomIdReply) Reset()
- func (x *GetAllRoomIdReply) String() string
- type GetAllRoomIdReq
- type HbCfg
- type HeartbeatReply
- type HeartbeatReq
- type KafkaSendMsg
- func (*KafkaSendMsg) Descriptor() ([]byte, []int)deprecated
- func (x *KafkaSendMsg) GetMsg() []byte
- func (x *KafkaSendMsg) GetRoomId() string
- func (x *KafkaSendMsg) GetServerId() string
- func (x *KafkaSendMsg) GetSpeed() int32
- func (x *KafkaSendMsg) GetSubId() int32
- func (x *KafkaSendMsg) GetTcpSessionIds() []string
- func (x *KafkaSendMsg) GetType() KafkaSendMsg_Type
- func (*KafkaSendMsg) ProtoMessage()
- func (x *KafkaSendMsg) ProtoReflect() protoreflect.Message
- func (x *KafkaSendMsg) Reset()
- func (x *KafkaSendMsg) String() string
- type KafkaSendMsg_Type
- func (KafkaSendMsg_Type) Descriptor() protoreflect.EnumDescriptor
- func (x KafkaSendMsg_Type) Enum() *KafkaSendMsg_Type
- func (KafkaSendMsg_Type) EnumDescriptor() ([]byte, []int)deprecated
- func (x KafkaSendMsg_Type) Number() protoreflect.EnumNumber
- func (x KafkaSendMsg_Type) String() string
- func (KafkaSendMsg_Type) Type() protoreflect.EnumType
- type LogicClient
- type LogicServer
- type NodesReply
- func (*NodesReply) Descriptor() ([]byte, []int)deprecated
- func (x *NodesReply) GetBackoff() *Backoff
- func (x *NodesReply) GetDomain() string
- func (x *NodesReply) GetHbCfg() *HbCfg
- func (x *NodesReply) GetNodes() []string
- func (x *NodesReply) GetTcpPort() int32
- func (x *NodesReply) GetWsPort() int32
- func (x *NodesReply) GetWssPort() int32
- func (*NodesReply) ProtoMessage()
- func (x *NodesReply) ProtoReflect() protoreflect.Message
- func (x *NodesReply) Reset()
- func (x *NodesReply) String() string
- type NodesReq
- type OnlineReply
- type OnlineReq
- func (*OnlineReq) Descriptor() ([]byte, []int)deprecated
- func (x *OnlineReq) GetRoomCount() map[string]int32
- func (x *OnlineReq) GetServerId() string
- func (*OnlineReq) ProtoMessage()
- func (x *OnlineReq) ProtoReflect() protoreflect.Message
- func (x *OnlineReq) Reset()
- func (x *OnlineReq) String() string
- type Platform
- type ReceiveReply
- type ReceiveReq
- func (*ReceiveReq) Descriptor() ([]byte, []int)deprecated
- func (x *ReceiveReq) GetProto() *protocol.Proto
- func (x *ReceiveReq) GetUserId() uint64
- func (*ReceiveReq) ProtoMessage()
- func (x *ReceiveReq) ProtoReflect() protoreflect.Message
- func (x *ReceiveReq) Reset()
- func (x *ReceiveReq) String() string
- type SendToAllReply
- type SendToAllReq
- func (*SendToAllReq) Descriptor() ([]byte, []int)deprecated
- func (x *SendToAllReq) GetProto() *protocol.Proto
- func (x *SendToAllReq) GetSpeed() int32
- func (x *SendToAllReq) GetSubId() int32
- func (*SendToAllReq) ProtoMessage()
- func (x *SendToAllReq) ProtoReflect() protoreflect.Message
- func (x *SendToAllReq) Reset()
- func (x *SendToAllReq) String() string
- type SendToRoomReply
- type SendToRoomReq
- func (*SendToRoomReq) Descriptor() ([]byte, []int)deprecated
- func (x *SendToRoomReq) GetProto() *protocol.Proto
- func (x *SendToRoomReq) GetRoomId() string
- func (x *SendToRoomReq) GetSubId() int32
- func (*SendToRoomReq) ProtoMessage()
- func (x *SendToRoomReq) ProtoReflect() protoreflect.Message
- func (x *SendToRoomReq) Reset()
- func (x *SendToRoomReq) String() string
- type SendToUsersReply
- type SendToUsersReq
- func (*SendToUsersReq) Descriptor() ([]byte, []int)deprecated
- func (x *SendToUsersReq) GetProto() *protocol.Proto
- func (x *SendToUsersReq) GetSubId() int32
- func (x *SendToUsersReq) GetTcpSessionIds() []string
- func (*SendToUsersReq) ProtoMessage()
- func (x *SendToUsersReq) ProtoReflect() protoreflect.Message
- func (x *SendToUsersReq) Reset()
- func (x *SendToUsersReq) String() string
- type UnimplementedCometServer
- func (UnimplementedCometServer) GetAllRoomId(context.Context, *GetAllRoomIdReq) (*GetAllRoomIdReply, error)
- func (UnimplementedCometServer) SendToAll(context.Context, *SendToAllReq) (*SendToAllReply, error)
- func (UnimplementedCometServer) SendToRoom(context.Context, *SendToRoomReq) (*SendToRoomReply, error)
- func (UnimplementedCometServer) SendToUsers(context.Context, *SendToUsersReq) (*SendToUsersReply, error)
- type UnimplementedLogicServer
- func (UnimplementedLogicServer) Connect(context.Context, *ConnectReq) (*ConnectReply, error)
- func (UnimplementedLogicServer) Disconnect(context.Context, *DisconnectReq) (*DisconnectReply, error)
- func (UnimplementedLogicServer) Heartbeat(context.Context, *HeartbeatReq) (*HeartbeatReply, error)
- func (UnimplementedLogicServer) Nodes(context.Context, *NodesReq) (*NodesReply, error)
- func (UnimplementedLogicServer) Receive(context.Context, *ReceiveReq) (*ReceiveReply, error)
- func (UnimplementedLogicServer) RenewOnline(context.Context, *OnlineReq) (*OnlineReply, error)
- type UnsafeCometServer
- type UnsafeLogicServer
Constants ¶
This section is empty.
Variables ¶
var ( Platform_name = map[int32]string{ 0: "Platform_None", 1: "Platform_PC", 2: "Platform_Android", 3: "Platform_Ios", 4: "Platform_Web", 5: "Platform_MinProgram", } Platform_value = map[string]int32{ "Platform_None": 0, "Platform_PC": 1, "Platform_Android": 2, "Platform_Ios": 3, "Platform_Web": 4, "Platform_MinProgram": 5, } )
Enum value maps for Platform.
var ( KafkaSendMsg_Type_name = map[int32]string{ 0: "ToUsers", 1: "ToRoom", 2: "ToAll", } KafkaSendMsg_Type_value = map[string]int32{ "ToUsers": 0, "ToRoom": 1, "ToAll": 2, } )
Enum value maps for KafkaSendMsg_Type.
var Comet_ServiceDesc = grpc.ServiceDesc{ ServiceName: "imfun.comet.Comet", HandlerType: (*CometServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "SendToUsers", Handler: _Comet_SendToUsers_Handler, }, { MethodName: "SendToRoom", Handler: _Comet_SendToRoom_Handler, }, { MethodName: "SendToAll", Handler: _Comet_SendToAll_Handler, }, { MethodName: "GetAllRoomId", Handler: _Comet_GetAllRoomId_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "comet.proto", }
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 File_comet_proto protoreflect.FileDescriptor
var File_logic_proto protoreflect.FileDescriptor
var Logic_ServiceDesc = grpc.ServiceDesc{ ServiceName: "imfun.logic.Logic", HandlerType: (*LogicServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Connect", Handler: _Logic_Connect_Handler, }, { MethodName: "Disconnect", Handler: _Logic_Disconnect_Handler, }, { MethodName: "Heartbeat", Handler: _Logic_Heartbeat_Handler, }, { MethodName: "RenewOnline", Handler: _Logic_RenewOnline_Handler, }, { MethodName: "Receive", Handler: _Logic_Receive_Handler, }, { MethodName: "Nodes", Handler: _Logic_Nodes_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "logic.proto", }
Logic_ServiceDesc is the grpc.ServiceDesc for Logic service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterCometServer ¶
func RegisterCometServer(s grpc.ServiceRegistrar, srv CometServer)
func RegisterLogicServer ¶
func RegisterLogicServer(s grpc.ServiceRegistrar, srv LogicServer)
Types ¶
type Backoff ¶
type Backoff struct { BaseDelay int32 `protobuf:"varint,1,opt,name=base_delay,json=baseDelay,proto3" json:"base_delay,omitempty"` Multiplier float32 `protobuf:"fixed32,2,opt,name=multiplier,proto3" json:"multiplier,omitempty"` Jitter float32 `protobuf:"fixed32,3,opt,name=jitter,proto3" json:"jitter,omitempty"` MaxDelay int32 `protobuf:"varint,4,opt,name=max_delay,json=maxDelay,proto3" json:"max_delay,omitempty"` // contains filtered or unexported fields }
func (*Backoff) Descriptor
deprecated
func (*Backoff) GetBaseDelay ¶
func (*Backoff) GetMaxDelay ¶
func (*Backoff) GetMultiplier ¶
func (*Backoff) ProtoMessage ¶
func (*Backoff) ProtoMessage()
func (*Backoff) ProtoReflect ¶
func (x *Backoff) ProtoReflect() protoreflect.Message
type CometClient ¶
type CometClient interface { // send msg: to some user SendToUsers(ctx context.Context, in *SendToUsersReq, opts ...grpc.CallOption) (*SendToUsersReply, error) // send msg: to room's user SendToRoom(ctx context.Context, in *SendToRoomReq, opts ...grpc.CallOption) (*SendToRoomReply, error) // send msg: to every user in the app SendToAll(ctx context.Context, in *SendToAllReq, opts ...grpc.CallOption) (*SendToAllReply, error) // get all rooms GetAllRoomId(ctx context.Context, in *GetAllRoomIdReq, opts ...grpc.CallOption) (*GetAllRoomIdReply, error) }
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.
func NewCometClient ¶
func NewCometClient(cc grpc.ClientConnInterface) CometClient
type CometServer ¶
type CometServer interface { // send msg: to some user SendToUsers(context.Context, *SendToUsersReq) (*SendToUsersReply, error) // send msg: to room's user SendToRoom(context.Context, *SendToRoomReq) (*SendToRoomReply, error) // send msg: to every user in the app SendToAll(context.Context, *SendToAllReq) (*SendToAllReply, error) // get all rooms GetAllRoomId(context.Context, *GetAllRoomIdReq) (*GetAllRoomIdReply, error) // contains filtered or unexported methods }
CometServer is the server API for Comet service. All implementations must embed UnimplementedCometServer for forward compatibility
type ConnectCommon ¶
type ConnectCommon struct { ServerId string `protobuf:"bytes,1,opt,name=serverId,proto3" json:"serverId,omitempty"` UserId uint64 `protobuf:"varint,2,opt,name=userId,proto3" json:"userId,omitempty"` TcpSessionId string `protobuf:"bytes,3,opt,name=tcpSessionId,proto3" json:"tcpSessionId,omitempty"` // contains filtered or unexported fields }
func (*ConnectCommon) Descriptor
deprecated
func (*ConnectCommon) Descriptor() ([]byte, []int)
Deprecated: Use ConnectCommon.ProtoReflect.Descriptor instead.
func (*ConnectCommon) GetServerId ¶
func (x *ConnectCommon) GetServerId() string
func (*ConnectCommon) GetTcpSessionId ¶
func (x *ConnectCommon) GetTcpSessionId() string
func (*ConnectCommon) GetUserId ¶
func (x *ConnectCommon) GetUserId() uint64
func (*ConnectCommon) ProtoMessage ¶
func (*ConnectCommon) ProtoMessage()
func (*ConnectCommon) ProtoReflect ¶
func (x *ConnectCommon) ProtoReflect() protoreflect.Message
func (*ConnectCommon) Reset ¶
func (x *ConnectCommon) Reset()
func (*ConnectCommon) String ¶
func (x *ConnectCommon) String() string
type ConnectReply ¶
type ConnectReply struct { HbCfg *HbCfg `protobuf:"bytes,1,opt,name=hb_cfg,json=hbCfg,proto3" json:"hb_cfg,omitempty"` // contains filtered or unexported fields }
func (*ConnectReply) Descriptor
deprecated
func (*ConnectReply) Descriptor() ([]byte, []int)
Deprecated: Use ConnectReply.ProtoReflect.Descriptor instead.
func (*ConnectReply) GetHbCfg ¶
func (x *ConnectReply) GetHbCfg() *HbCfg
func (*ConnectReply) ProtoMessage ¶
func (*ConnectReply) ProtoMessage()
func (*ConnectReply) ProtoReflect ¶
func (x *ConnectReply) ProtoReflect() protoreflect.Message
func (*ConnectReply) Reset ¶
func (x *ConnectReply) Reset()
func (*ConnectReply) String ¶
func (x *ConnectReply) String() string
type ConnectReq ¶
type ConnectReq struct { Comm *ConnectCommon `protobuf:"bytes,1,opt,name=comm,proto3" json:"comm,omitempty"` RoomId string `protobuf:"bytes,4,opt,name=roomId,proto3" json:"roomId,omitempty"` Token string `protobuf:"bytes,5,opt,name=token,proto3" json:"token,omitempty"` Platform Platform `protobuf:"varint,6,opt,name=platform,proto3,enum=imfun.logic.Platform" json:"platform,omitempty"` // contains filtered or unexported fields }
建立TCP连接,并且auth后,保存映射关系
func (*ConnectReq) Descriptor
deprecated
func (*ConnectReq) Descriptor() ([]byte, []int)
Deprecated: Use ConnectReq.ProtoReflect.Descriptor instead.
func (*ConnectReq) GetComm ¶
func (x *ConnectReq) GetComm() *ConnectCommon
func (*ConnectReq) GetPlatform ¶
func (x *ConnectReq) GetPlatform() Platform
func (*ConnectReq) GetRoomId ¶
func (x *ConnectReq) GetRoomId() string
func (*ConnectReq) GetToken ¶
func (x *ConnectReq) GetToken() string
func (*ConnectReq) ProtoMessage ¶
func (*ConnectReq) ProtoMessage()
func (*ConnectReq) ProtoReflect ¶
func (x *ConnectReq) ProtoReflect() protoreflect.Message
func (*ConnectReq) Reset ¶
func (x *ConnectReq) Reset()
func (*ConnectReq) String ¶
func (x *ConnectReq) String() string
type DisconnectReply ¶
type DisconnectReply struct { Has bool `protobuf:"varint,1,opt,name=has,proto3" json:"has,omitempty"` // contains filtered or unexported fields }
func (*DisconnectReply) Descriptor
deprecated
func (*DisconnectReply) Descriptor() ([]byte, []int)
Deprecated: Use DisconnectReply.ProtoReflect.Descriptor instead.
func (*DisconnectReply) GetHas ¶
func (x *DisconnectReply) GetHas() bool
func (*DisconnectReply) ProtoMessage ¶
func (*DisconnectReply) ProtoMessage()
func (*DisconnectReply) ProtoReflect ¶
func (x *DisconnectReply) ProtoReflect() protoreflect.Message
func (*DisconnectReply) Reset ¶
func (x *DisconnectReply) Reset()
func (*DisconnectReply) String ¶
func (x *DisconnectReply) String() string
type DisconnectReq ¶
type DisconnectReq struct { Comm *ConnectCommon `protobuf:"bytes,1,opt,name=comm,proto3" json:"comm,omitempty"` // contains filtered or unexported fields }
断开TCP连接,删除映射关系
func (*DisconnectReq) Descriptor
deprecated
func (*DisconnectReq) Descriptor() ([]byte, []int)
Deprecated: Use DisconnectReq.ProtoReflect.Descriptor instead.
func (*DisconnectReq) GetComm ¶
func (x *DisconnectReq) GetComm() *ConnectCommon
func (*DisconnectReq) ProtoMessage ¶
func (*DisconnectReq) ProtoMessage()
func (*DisconnectReq) ProtoReflect ¶
func (x *DisconnectReq) ProtoReflect() protoreflect.Message
func (*DisconnectReq) Reset ¶
func (x *DisconnectReq) Reset()
func (*DisconnectReq) String ¶
func (x *DisconnectReq) String() string
type GetAllRoomIdReply ¶
type GetAllRoomIdReply struct { Rooms map[string]bool `` /* 152-byte string literal not displayed */ // contains filtered or unexported fields }
func (*GetAllRoomIdReply) Descriptor
deprecated
func (*GetAllRoomIdReply) Descriptor() ([]byte, []int)
Deprecated: Use GetAllRoomIdReply.ProtoReflect.Descriptor instead.
func (*GetAllRoomIdReply) GetRooms ¶
func (x *GetAllRoomIdReply) GetRooms() map[string]bool
func (*GetAllRoomIdReply) ProtoMessage ¶
func (*GetAllRoomIdReply) ProtoMessage()
func (*GetAllRoomIdReply) ProtoReflect ¶
func (x *GetAllRoomIdReply) ProtoReflect() protoreflect.Message
func (*GetAllRoomIdReply) Reset ¶
func (x *GetAllRoomIdReply) Reset()
func (*GetAllRoomIdReply) String ¶
func (x *GetAllRoomIdReply) String() string
type GetAllRoomIdReq ¶
type GetAllRoomIdReq struct {
// contains filtered or unexported fields
}
room's
func (*GetAllRoomIdReq) Descriptor
deprecated
func (*GetAllRoomIdReq) Descriptor() ([]byte, []int)
Deprecated: Use GetAllRoomIdReq.ProtoReflect.Descriptor instead.
func (*GetAllRoomIdReq) ProtoMessage ¶
func (*GetAllRoomIdReq) ProtoMessage()
func (*GetAllRoomIdReq) ProtoReflect ¶
func (x *GetAllRoomIdReq) ProtoReflect() protoreflect.Message
func (*GetAllRoomIdReq) Reset ¶
func (x *GetAllRoomIdReq) Reset()
func (*GetAllRoomIdReq) String ¶
func (x *GetAllRoomIdReq) String() string
type HbCfg ¶
type HbCfg struct { Interval int64 `protobuf:"varint,1,opt,name=interval,proto3" json:"interval,omitempty"` // 心跳间隔 FailCount int64 `protobuf:"varint,2,opt,name=fail_count,json=failCount,proto3" json:"fail_count,omitempty"` // 心跳失败次数 // contains filtered or unexported fields }
func (*HbCfg) Descriptor
deprecated
func (*HbCfg) GetFailCount ¶
func (*HbCfg) GetInterval ¶
func (*HbCfg) ProtoMessage ¶
func (*HbCfg) ProtoMessage()
func (*HbCfg) ProtoReflect ¶
func (x *HbCfg) ProtoReflect() protoreflect.Message
type HeartbeatReply ¶
type HeartbeatReply struct { Has bool `protobuf:"varint,1,opt,name=has,proto3" json:"has,omitempty"` // contains filtered or unexported fields }
func (*HeartbeatReply) Descriptor
deprecated
func (*HeartbeatReply) Descriptor() ([]byte, []int)
Deprecated: Use HeartbeatReply.ProtoReflect.Descriptor instead.
func (*HeartbeatReply) GetHas ¶
func (x *HeartbeatReply) GetHas() bool
func (*HeartbeatReply) ProtoMessage ¶
func (*HeartbeatReply) ProtoMessage()
func (*HeartbeatReply) ProtoReflect ¶
func (x *HeartbeatReply) ProtoReflect() protoreflect.Message
func (*HeartbeatReply) Reset ¶
func (x *HeartbeatReply) Reset()
func (*HeartbeatReply) String ¶
func (x *HeartbeatReply) String() string
type HeartbeatReq ¶
type HeartbeatReq struct { Comm *ConnectCommon `protobuf:"bytes,1,opt,name=comm,proto3" json:"comm,omitempty"` // contains filtered or unexported fields }
func (*HeartbeatReq) Descriptor
deprecated
func (*HeartbeatReq) Descriptor() ([]byte, []int)
Deprecated: Use HeartbeatReq.ProtoReflect.Descriptor instead.
func (*HeartbeatReq) GetComm ¶
func (x *HeartbeatReq) GetComm() *ConnectCommon
func (*HeartbeatReq) ProtoMessage ¶
func (*HeartbeatReq) ProtoMessage()
func (*HeartbeatReq) ProtoReflect ¶
func (x *HeartbeatReq) ProtoReflect() protoreflect.Message
func (*HeartbeatReq) Reset ¶
func (x *HeartbeatReq) Reset()
func (*HeartbeatReq) String ¶
func (x *HeartbeatReq) String() string
type KafkaSendMsg ¶
type KafkaSendMsg struct { Type KafkaSendMsg_Type `protobuf:"varint,1,opt,name=type,proto3,enum=imfun.logic.KafkaSendMsg_Type" json:"type,omitempty"` SubId int32 `protobuf:"varint,2,opt,name=subId,proto3" json:"subId,omitempty"` Speed int32 `protobuf:"varint,3,opt,name=speed,proto3" json:"speed,omitempty"` ServerId string `protobuf:"bytes,4,opt,name=serverId,proto3" json:"serverId,omitempty"` RoomId string `protobuf:"bytes,5,opt,name=roomId,proto3" json:"roomId,omitempty"` TcpSessionIds []string `protobuf:"bytes,6,rep,name=tcpSessionIds,proto3" json:"tcpSessionIds,omitempty"` Msg []byte `protobuf:"bytes,7,opt,name=msg,proto3" json:"msg,omitempty"` // contains filtered or unexported fields }
func (*KafkaSendMsg) Descriptor
deprecated
func (*KafkaSendMsg) Descriptor() ([]byte, []int)
Deprecated: Use KafkaSendMsg.ProtoReflect.Descriptor instead.
func (*KafkaSendMsg) GetMsg ¶
func (x *KafkaSendMsg) GetMsg() []byte
func (*KafkaSendMsg) GetRoomId ¶
func (x *KafkaSendMsg) GetRoomId() string
func (*KafkaSendMsg) GetServerId ¶
func (x *KafkaSendMsg) GetServerId() string
func (*KafkaSendMsg) GetSpeed ¶
func (x *KafkaSendMsg) GetSpeed() int32
func (*KafkaSendMsg) GetSubId ¶
func (x *KafkaSendMsg) GetSubId() int32
func (*KafkaSendMsg) GetTcpSessionIds ¶
func (x *KafkaSendMsg) GetTcpSessionIds() []string
func (*KafkaSendMsg) GetType ¶
func (x *KafkaSendMsg) GetType() KafkaSendMsg_Type
func (*KafkaSendMsg) ProtoMessage ¶
func (*KafkaSendMsg) ProtoMessage()
func (*KafkaSendMsg) ProtoReflect ¶
func (x *KafkaSendMsg) ProtoReflect() protoreflect.Message
func (*KafkaSendMsg) Reset ¶
func (x *KafkaSendMsg) Reset()
func (*KafkaSendMsg) String ¶
func (x *KafkaSendMsg) String() string
type KafkaSendMsg_Type ¶
type KafkaSendMsg_Type int32
const ( KafkaSendMsg_ToUsers KafkaSendMsg_Type = 0 KafkaSendMsg_ToRoom KafkaSendMsg_Type = 1 KafkaSendMsg_ToAll KafkaSendMsg_Type = 2 )
func (KafkaSendMsg_Type) Descriptor ¶
func (KafkaSendMsg_Type) Descriptor() protoreflect.EnumDescriptor
func (KafkaSendMsg_Type) Enum ¶
func (x KafkaSendMsg_Type) Enum() *KafkaSendMsg_Type
func (KafkaSendMsg_Type) EnumDescriptor
deprecated
func (KafkaSendMsg_Type) EnumDescriptor() ([]byte, []int)
Deprecated: Use KafkaSendMsg_Type.Descriptor instead.
func (KafkaSendMsg_Type) Number ¶
func (x KafkaSendMsg_Type) Number() protoreflect.EnumNumber
func (KafkaSendMsg_Type) String ¶
func (x KafkaSendMsg_Type) String() string
func (KafkaSendMsg_Type) Type ¶
func (KafkaSendMsg_Type) Type() protoreflect.EnumType
type LogicClient ¶
type LogicClient interface { // 建立TCP连接,并且auth后,保存映射关系 Connect(ctx context.Context, in *ConnectReq, opts ...grpc.CallOption) (*ConnectReply, error) // 断开TCP连接,删除映射关系 Disconnect(ctx context.Context, in *DisconnectReq, opts ...grpc.CallOption) (*DisconnectReply, error) // Heartbeat Heartbeat(ctx context.Context, in *HeartbeatReq, opts ...grpc.CallOption) (*HeartbeatReply, error) // RenewOnline RenewOnline(ctx context.Context, in *OnlineReq, opts ...grpc.CallOption) (*OnlineReply, error) // Receive Receive(ctx context.Context, in *ReceiveReq, opts ...grpc.CallOption) (*ReceiveReply, error) // ServerList Nodes(ctx context.Context, in *NodesReq, opts ...grpc.CallOption) (*NodesReply, error) }
LogicClient is the client API for Logic 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.
func NewLogicClient ¶
func NewLogicClient(cc grpc.ClientConnInterface) LogicClient
type LogicServer ¶
type LogicServer interface { // 建立TCP连接,并且auth后,保存映射关系 Connect(context.Context, *ConnectReq) (*ConnectReply, error) // 断开TCP连接,删除映射关系 Disconnect(context.Context, *DisconnectReq) (*DisconnectReply, error) // Heartbeat Heartbeat(context.Context, *HeartbeatReq) (*HeartbeatReply, error) // RenewOnline RenewOnline(context.Context, *OnlineReq) (*OnlineReply, error) // Receive Receive(context.Context, *ReceiveReq) (*ReceiveReply, error) // ServerList Nodes(context.Context, *NodesReq) (*NodesReply, error) // contains filtered or unexported methods }
LogicServer is the server API for Logic service. All implementations must embed UnimplementedLogicServer for forward compatibility
type NodesReply ¶
type NodesReply struct { Domain string `protobuf:"bytes,1,opt,name=domain,proto3" json:"domain,omitempty"` TcpPort int32 `protobuf:"varint,2,opt,name=tcp_port,json=tcpPort,proto3" json:"tcp_port,omitempty"` WsPort int32 `protobuf:"varint,3,opt,name=ws_port,json=wsPort,proto3" json:"ws_port,omitempty"` WssPort int32 `protobuf:"varint,4,opt,name=wss_port,json=wssPort,proto3" json:"wss_port,omitempty"` HbCfg *HbCfg `protobuf:"bytes,5,opt,name=hb_cfg,json=hbCfg,proto3" json:"hb_cfg,omitempty"` Nodes []string `protobuf:"bytes,6,rep,name=nodes,proto3" json:"nodes,omitempty"` Backoff *Backoff `protobuf:"bytes,7,opt,name=backoff,proto3" json:"backoff,omitempty"` // contains filtered or unexported fields }
func (*NodesReply) Descriptor
deprecated
func (*NodesReply) Descriptor() ([]byte, []int)
Deprecated: Use NodesReply.ProtoReflect.Descriptor instead.
func (*NodesReply) GetBackoff ¶
func (x *NodesReply) GetBackoff() *Backoff
func (*NodesReply) GetDomain ¶
func (x *NodesReply) GetDomain() string
func (*NodesReply) GetHbCfg ¶
func (x *NodesReply) GetHbCfg() *HbCfg
func (*NodesReply) GetNodes ¶
func (x *NodesReply) GetNodes() []string
func (*NodesReply) GetTcpPort ¶
func (x *NodesReply) GetTcpPort() int32
func (*NodesReply) GetWsPort ¶
func (x *NodesReply) GetWsPort() int32
func (*NodesReply) GetWssPort ¶
func (x *NodesReply) GetWssPort() int32
func (*NodesReply) ProtoMessage ¶
func (*NodesReply) ProtoMessage()
func (*NodesReply) ProtoReflect ¶
func (x *NodesReply) ProtoReflect() protoreflect.Message
func (*NodesReply) Reset ¶
func (x *NodesReply) Reset()
func (*NodesReply) String ¶
func (x *NodesReply) String() string
type NodesReq ¶
type NodesReq struct { Platform Platform `protobuf:"varint,1,opt,name=platform,proto3,enum=imfun.logic.Platform" json:"platform,omitempty"` ClientIP string `protobuf:"bytes,2,opt,name=clientIP,proto3" json:"clientIP,omitempty"` // contains filtered or unexported fields }
func (*NodesReq) Descriptor
deprecated
func (*NodesReq) GetClientIP ¶
func (*NodesReq) GetPlatform ¶
func (*NodesReq) ProtoMessage ¶
func (*NodesReq) ProtoMessage()
func (*NodesReq) ProtoReflect ¶
func (x *NodesReq) ProtoReflect() protoreflect.Message
type OnlineReply ¶
type OnlineReply struct { AllRoomCount map[string]int32 `` /* 166-byte string literal not displayed */ // contains filtered or unexported fields }
func (*OnlineReply) Descriptor
deprecated
func (*OnlineReply) Descriptor() ([]byte, []int)
Deprecated: Use OnlineReply.ProtoReflect.Descriptor instead.
func (*OnlineReply) GetAllRoomCount ¶
func (x *OnlineReply) GetAllRoomCount() map[string]int32
func (*OnlineReply) ProtoMessage ¶
func (*OnlineReply) ProtoMessage()
func (*OnlineReply) ProtoReflect ¶
func (x *OnlineReply) ProtoReflect() protoreflect.Message
func (*OnlineReply) Reset ¶
func (x *OnlineReply) Reset()
func (*OnlineReply) String ¶
func (x *OnlineReply) String() string
type OnlineReq ¶
type OnlineReq struct { ServerId string `protobuf:"bytes,1,opt,name=serverId,proto3" json:"serverId,omitempty"` RoomCount map[string]int32 `` /* 160-byte string literal not displayed */ // contains filtered or unexported fields }
func (*OnlineReq) Descriptor
deprecated
func (*OnlineReq) GetRoomCount ¶
func (*OnlineReq) GetServerId ¶
func (*OnlineReq) ProtoMessage ¶
func (*OnlineReq) ProtoMessage()
func (*OnlineReq) ProtoReflect ¶
func (x *OnlineReq) ProtoReflect() protoreflect.Message
type Platform ¶
type Platform int32
平台
func (Platform) Descriptor ¶
func (Platform) Descriptor() protoreflect.EnumDescriptor
func (Platform) EnumDescriptor
deprecated
func (Platform) Number ¶
func (x Platform) Number() protoreflect.EnumNumber
func (Platform) Type ¶
func (Platform) Type() protoreflect.EnumType
type ReceiveReply ¶
type ReceiveReply struct {
// contains filtered or unexported fields
}
func (*ReceiveReply) Descriptor
deprecated
func (*ReceiveReply) Descriptor() ([]byte, []int)
Deprecated: Use ReceiveReply.ProtoReflect.Descriptor instead.
func (*ReceiveReply) ProtoMessage ¶
func (*ReceiveReply) ProtoMessage()
func (*ReceiveReply) ProtoReflect ¶
func (x *ReceiveReply) ProtoReflect() protoreflect.Message
func (*ReceiveReply) Reset ¶
func (x *ReceiveReply) Reset()
func (*ReceiveReply) String ¶
func (x *ReceiveReply) String() string
type ReceiveReq ¶
type ReceiveReq struct { UserId uint64 `protobuf:"varint,1,opt,name=userId,proto3" json:"userId,omitempty"` Proto *protocol.Proto `protobuf:"bytes,2,opt,name=proto,proto3" json:"proto,omitempty"` // contains filtered or unexported fields }
func (*ReceiveReq) Descriptor
deprecated
func (*ReceiveReq) Descriptor() ([]byte, []int)
Deprecated: Use ReceiveReq.ProtoReflect.Descriptor instead.
func (*ReceiveReq) GetProto ¶
func (x *ReceiveReq) GetProto() *protocol.Proto
func (*ReceiveReq) GetUserId ¶
func (x *ReceiveReq) GetUserId() uint64
func (*ReceiveReq) ProtoMessage ¶
func (*ReceiveReq) ProtoMessage()
func (*ReceiveReq) ProtoReflect ¶
func (x *ReceiveReq) ProtoReflect() protoreflect.Message
func (*ReceiveReq) Reset ¶
func (x *ReceiveReq) Reset()
func (*ReceiveReq) String ¶
func (x *ReceiveReq) String() string
type SendToAllReply ¶
type SendToAllReply struct {
// contains filtered or unexported fields
}
func (*SendToAllReply) Descriptor
deprecated
func (*SendToAllReply) Descriptor() ([]byte, []int)
Deprecated: Use SendToAllReply.ProtoReflect.Descriptor instead.
func (*SendToAllReply) ProtoMessage ¶
func (*SendToAllReply) ProtoMessage()
func (*SendToAllReply) ProtoReflect ¶
func (x *SendToAllReply) ProtoReflect() protoreflect.Message
func (*SendToAllReply) Reset ¶
func (x *SendToAllReply) Reset()
func (*SendToAllReply) String ¶
func (x *SendToAllReply) String() string
type SendToAllReq ¶
type SendToAllReq struct { Proto *protocol.Proto `protobuf:"bytes,1,opt,name=proto,proto3" json:"proto,omitempty"` SubId int32 `protobuf:"varint,2,opt,name=subId,proto3" json:"subId,omitempty"` Speed int32 `protobuf:"varint,3,opt,name=speed,proto3" json:"speed,omitempty"` // contains filtered or unexported fields }
all users
func (*SendToAllReq) Descriptor
deprecated
func (*SendToAllReq) Descriptor() ([]byte, []int)
Deprecated: Use SendToAllReq.ProtoReflect.Descriptor instead.
func (*SendToAllReq) GetProto ¶
func (x *SendToAllReq) GetProto() *protocol.Proto
func (*SendToAllReq) GetSpeed ¶
func (x *SendToAllReq) GetSpeed() int32
func (*SendToAllReq) GetSubId ¶
func (x *SendToAllReq) GetSubId() int32
func (*SendToAllReq) ProtoMessage ¶
func (*SendToAllReq) ProtoMessage()
func (*SendToAllReq) ProtoReflect ¶
func (x *SendToAllReq) ProtoReflect() protoreflect.Message
func (*SendToAllReq) Reset ¶
func (x *SendToAllReq) Reset()
func (*SendToAllReq) String ¶
func (x *SendToAllReq) String() string
type SendToRoomReply ¶
type SendToRoomReply struct {
// contains filtered or unexported fields
}
func (*SendToRoomReply) Descriptor
deprecated
func (*SendToRoomReply) Descriptor() ([]byte, []int)
Deprecated: Use SendToRoomReply.ProtoReflect.Descriptor instead.
func (*SendToRoomReply) ProtoMessage ¶
func (*SendToRoomReply) ProtoMessage()
func (*SendToRoomReply) ProtoReflect ¶
func (x *SendToRoomReply) ProtoReflect() protoreflect.Message
func (*SendToRoomReply) Reset ¶
func (x *SendToRoomReply) Reset()
func (*SendToRoomReply) String ¶
func (x *SendToRoomReply) String() string
type SendToRoomReq ¶
type SendToRoomReq struct { RoomId string `protobuf:"bytes,1,opt,name=roomId,proto3" json:"roomId,omitempty"` Proto *protocol.Proto `protobuf:"bytes,2,opt,name=proto,proto3" json:"proto,omitempty"` SubId int32 `protobuf:"varint,3,opt,name=subId,proto3" json:"subId,omitempty"` // contains filtered or unexported fields }
room users
func (*SendToRoomReq) Descriptor
deprecated
func (*SendToRoomReq) Descriptor() ([]byte, []int)
Deprecated: Use SendToRoomReq.ProtoReflect.Descriptor instead.
func (*SendToRoomReq) GetProto ¶
func (x *SendToRoomReq) GetProto() *protocol.Proto
func (*SendToRoomReq) GetRoomId ¶
func (x *SendToRoomReq) GetRoomId() string
func (*SendToRoomReq) GetSubId ¶
func (x *SendToRoomReq) GetSubId() int32
func (*SendToRoomReq) ProtoMessage ¶
func (*SendToRoomReq) ProtoMessage()
func (*SendToRoomReq) ProtoReflect ¶
func (x *SendToRoomReq) ProtoReflect() protoreflect.Message
func (*SendToRoomReq) Reset ¶
func (x *SendToRoomReq) Reset()
func (*SendToRoomReq) String ¶
func (x *SendToRoomReq) String() string
type SendToUsersReply ¶
type SendToUsersReply struct {
// contains filtered or unexported fields
}
func (*SendToUsersReply) Descriptor
deprecated
func (*SendToUsersReply) Descriptor() ([]byte, []int)
Deprecated: Use SendToUsersReply.ProtoReflect.Descriptor instead.
func (*SendToUsersReply) ProtoMessage ¶
func (*SendToUsersReply) ProtoMessage()
func (*SendToUsersReply) ProtoReflect ¶
func (x *SendToUsersReply) ProtoReflect() protoreflect.Message
func (*SendToUsersReply) Reset ¶
func (x *SendToUsersReply) Reset()
func (*SendToUsersReply) String ¶
func (x *SendToUsersReply) String() string
type SendToUsersReq ¶
type SendToUsersReq struct { TcpSessionIds []string `protobuf:"bytes,1,rep,name=tcpSessionIds,proto3" json:"tcpSessionIds,omitempty"` Proto *protocol.Proto `protobuf:"bytes,2,opt,name=proto,proto3" json:"proto,omitempty"` SubId int32 `protobuf:"varint,3,opt,name=subId,proto3" json:"subId,omitempty"` // contains filtered or unexported fields }
users
func (*SendToUsersReq) Descriptor
deprecated
func (*SendToUsersReq) Descriptor() ([]byte, []int)
Deprecated: Use SendToUsersReq.ProtoReflect.Descriptor instead.
func (*SendToUsersReq) GetProto ¶
func (x *SendToUsersReq) GetProto() *protocol.Proto
func (*SendToUsersReq) GetSubId ¶
func (x *SendToUsersReq) GetSubId() int32
func (*SendToUsersReq) GetTcpSessionIds ¶
func (x *SendToUsersReq) GetTcpSessionIds() []string
func (*SendToUsersReq) ProtoMessage ¶
func (*SendToUsersReq) ProtoMessage()
func (*SendToUsersReq) ProtoReflect ¶
func (x *SendToUsersReq) ProtoReflect() protoreflect.Message
func (*SendToUsersReq) Reset ¶
func (x *SendToUsersReq) Reset()
func (*SendToUsersReq) String ¶
func (x *SendToUsersReq) String() string
type UnimplementedCometServer ¶
type UnimplementedCometServer struct { }
UnimplementedCometServer must be embedded to have forward compatible implementations.
func (UnimplementedCometServer) GetAllRoomId ¶
func (UnimplementedCometServer) GetAllRoomId(context.Context, *GetAllRoomIdReq) (*GetAllRoomIdReply, error)
func (UnimplementedCometServer) SendToAll ¶
func (UnimplementedCometServer) SendToAll(context.Context, *SendToAllReq) (*SendToAllReply, error)
func (UnimplementedCometServer) SendToRoom ¶
func (UnimplementedCometServer) SendToRoom(context.Context, *SendToRoomReq) (*SendToRoomReply, error)
func (UnimplementedCometServer) SendToUsers ¶
func (UnimplementedCometServer) SendToUsers(context.Context, *SendToUsersReq) (*SendToUsersReply, error)
type UnimplementedLogicServer ¶
type UnimplementedLogicServer struct { }
UnimplementedLogicServer must be embedded to have forward compatible implementations.
func (UnimplementedLogicServer) Connect ¶
func (UnimplementedLogicServer) Connect(context.Context, *ConnectReq) (*ConnectReply, error)
func (UnimplementedLogicServer) Disconnect ¶
func (UnimplementedLogicServer) Disconnect(context.Context, *DisconnectReq) (*DisconnectReply, error)
func (UnimplementedLogicServer) Heartbeat ¶
func (UnimplementedLogicServer) Heartbeat(context.Context, *HeartbeatReq) (*HeartbeatReply, error)
func (UnimplementedLogicServer) Nodes ¶
func (UnimplementedLogicServer) Nodes(context.Context, *NodesReq) (*NodesReply, error)
func (UnimplementedLogicServer) Receive ¶
func (UnimplementedLogicServer) Receive(context.Context, *ReceiveReq) (*ReceiveReply, error)
func (UnimplementedLogicServer) RenewOnline ¶
func (UnimplementedLogicServer) RenewOnline(context.Context, *OnlineReq) (*OnlineReply, error)
type UnsafeCometServer ¶
type UnsafeCometServer interface {
// contains filtered or unexported methods
}
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 UnsafeLogicServer ¶
type UnsafeLogicServer interface {
// contains filtered or unexported methods
}
UnsafeLogicServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to LogicServer will result in compilation errors.