Documentation ¶
Overview ¶
*
- Created by lock
- Date: 2019-08-09
- Time: 15:18
*
- Created by lock
- Date: 2019-08-09
- Time: 15:18
*
- Created by lock
- Date: 2019-08-09
- Time: 18:18
*
- Created by lock
- Date: 2019-08-10
- Time: 18:35
*
- Created by lock
- Date: 2019-08-09
- Time: 15:18
*
- Created by lock
- Date: 2019-08-12
- Time: 23:36
*
- Created by lock
- Date: 2019-08-10
- Time: 18:32
*
- Created by lock
- Date: 2020/4/14
*
- Created by lock
- Date: 2019-08-09
- Time: 15:19
Index ¶
- Constants
- type Bucket
- func (b *Bucket) BroadcastRoom(pushRoomMsgReq *proto.PushRoomMsgRequest)
- func (b *Bucket) Channel(userId int) (ch *Channel)
- func (b *Bucket) DeleteChannel(ch *Channel)
- func (b *Bucket) PushRoom(ch chan *proto.PushRoomMsgRequest)
- func (b *Bucket) Put(userId int, roomId int, ch *Channel) (err error)
- func (b *Bucket) Room(rid int) (room *Room)
- type BucketOptions
- type Channel
- type Connect
- func (c *Connect) InitConnectTcpRpcServer() (err error)
- func (c *Connect) InitConnectWebsocketRpcServer() (err error)
- func (c *Connect) InitLogicRpcClient() (err error)
- func (c *Connect) InitTcpServer() error
- func (c *Connect) InitWebsocket() error
- func (c *Connect) Run()
- func (c *Connect) RunTcp()
- func (c *Connect) ServeTcp(server *Server, conn *net.TCPConn, r int)
- type DefaultOperator
- type Operator
- type Room
- type RpcConnect
- type RpcConnectPush
- func (rpc *RpcConnectPush) PushRoomCount(ctx context.Context, pushRoomMsgReq *proto.PushRoomMsgRequest, ...) (err error)
- func (rpc *RpcConnectPush) PushRoomInfo(ctx context.Context, pushRoomMsgReq *proto.PushRoomMsgRequest, ...) (err error)
- func (rpc *RpcConnectPush) PushRoomMsg(ctx context.Context, pushRoomMsgReq *proto.PushRoomMsgRequest, ...) (err error)
- func (rpc *RpcConnectPush) PushSingleMsg(ctx context.Context, pushMsgReq *proto.PushMsgRequest, ...) (err error)
- type Server
- type ServerOptions
Constants ¶
View Source
const NoRoom = -1
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bucket ¶
type Bucket struct {
// contains filtered or unexported fields
}
func NewBucket ¶
func NewBucket(bucketOptions BucketOptions) (b *Bucket)
func (*Bucket) BroadcastRoom ¶
func (b *Bucket) BroadcastRoom(pushRoomMsgReq *proto.PushRoomMsgRequest)
func (*Bucket) DeleteChannel ¶
func (*Bucket) PushRoom ¶
func (b *Bucket) PushRoom(ch chan *proto.PushRoomMsgRequest)
type BucketOptions ¶
type Channel ¶
type Channel struct { Room *Room Next *Channel Prev *Channel // contains filtered or unexported fields }
in fact, Channel it's a user Connect session
func NewChannel ¶
type Connect ¶
type Connect struct {
ServerId string
}
func (*Connect) InitConnectTcpRpcServer ¶
func (*Connect) InitConnectWebsocketRpcServer ¶
func (*Connect) InitLogicRpcClient ¶
func (*Connect) InitTcpServer ¶
func (*Connect) InitWebsocket ¶
type DefaultOperator ¶
type DefaultOperator struct { }
func (*DefaultOperator) Connect ¶
func (o *DefaultOperator) Connect(conn *proto.ConnectRequest) (uid int, err error)
rpc call logic layer
func (*DefaultOperator) DisConnect ¶
func (o *DefaultOperator) DisConnect(disConn *proto.DisConnectRequest) (err error)
rpc call logic layer
type Operator ¶
type Operator interface { Connect(conn *proto.ConnectRequest) (int, error) DisConnect(disConn *proto.DisConnectRequest) (err error) }
type Room ¶
type Room struct { Id int OnlineCount int // room online user count // contains filtered or unexported fields }
func (*Room) DeleteChannel ¶
type RpcConnect ¶
type RpcConnect struct { }
func (*RpcConnect) Connect ¶
func (rpc *RpcConnect) Connect(connReq *proto.ConnectRequest) (uid int, err error)
func (*RpcConnect) DisConnect ¶
func (rpc *RpcConnect) DisConnect(disConnReq *proto.DisConnectRequest) (err error)
type RpcConnectPush ¶
type RpcConnectPush struct { }
func (*RpcConnectPush) PushRoomCount ¶
func (rpc *RpcConnectPush) PushRoomCount(ctx context.Context, pushRoomMsgReq *proto.PushRoomMsgRequest, successReply *proto.SuccessReply) (err error)
func (*RpcConnectPush) PushRoomInfo ¶
func (rpc *RpcConnectPush) PushRoomInfo(ctx context.Context, pushRoomMsgReq *proto.PushRoomMsgRequest, successReply *proto.SuccessReply) (err error)
func (*RpcConnectPush) PushRoomMsg ¶
func (rpc *RpcConnectPush) PushRoomMsg(ctx context.Context, pushRoomMsgReq *proto.PushRoomMsgRequest, successReply *proto.SuccessReply) (err error)
func (*RpcConnectPush) PushSingleMsg ¶
func (rpc *RpcConnectPush) PushSingleMsg(ctx context.Context, pushMsgReq *proto.PushMsgRequest, successReply *proto.SuccessReply) (err error)
type Server ¶
type Server struct { Buckets []*Bucket Options ServerOptions // contains filtered or unexported fields }
var DefaultServer *Server
Click to show internal directories.
Click to hide internal directories.