Documentation ¶
Overview ¶
*
- Created by yson
- Date: 2022-06-01
- Time: 15:18
*
- Created by yson
- Date: 2022-06-01
- Time: 15:18
*
- Created by yson
- Date: 2022-06-01
- Time: 18:18
*
- Created by yson
- Date: 2022-06-01
- Time: 15:18
Index ¶
- Constants
- func GenChannelIdByFriend(userId, friendId int64) string
- func GenChannelIdByGroup(groupName string) string
- func JoinChannelIds(uid string, channelIds ...string)
- func Run(svcCtx *svc.ServiceContext) error
- func SendMessageToChannelIds(uid string, msg string, tp uint8, channelIds ...string)
- func SendMessageToUid(uid string, toUId uint64, msg string, tp uint8)
- func SendMessageToUids(uid string, msg string, tp uint8, toUIds ...uint64)
- type Bucket
- func (b *Bucket) BroadcastRoom(pushRoomMsgReq *pb.PushRoomMsgRequest)
- func (b *Bucket) Channel(userId int64) (ch *Channel)
- func (b *Bucket) DeleteChannel(ch *Channel)
- func (b *Bucket) PushRoom(ch chan *pb.PushRoomMsgRequest)
- func (b *Bucket) Put(userId int64, roomId int64, ch *Channel) (err error)
- func (b *Bucket) Room(rid int64) (room *Room)
- type BucketOptions
- type Channel
- type Connect
- type Room
- type Server
- type ServerOptions
Constants ¶
View Source
const NoRoom = -1
Variables ¶
This section is empty.
Functions ¶
func GenChannelIdByFriend ¶
func GenChannelIdByGroup ¶
func JoinChannelIds ¶
func Run ¶
func Run(svcCtx *svc.ServiceContext) error
func SendMessageToChannelIds ¶
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 *pb.PushRoomMsgRequest)
func (*Bucket) DeleteChannel ¶
func (*Bucket) PushRoom ¶
func (b *Bucket) PushRoom(ch chan *pb.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 Room ¶
type Room struct { Id int64 OnlineCount int // room online user count // contains filtered or unexported fields }
func (*Room) DeleteChannel ¶
type Server ¶
type Server struct { Buckets []*Bucket Options ServerOptions Ctx context.Context SvcCtx *svc.ServiceContext // contains filtered or unexported fields }
var DefaultServer *Server
func NewServer ¶
func NewServer(b []*Bucket, options ServerOptions) *Server
Source Files ¶
Click to show internal directories.
Click to hide internal directories.