Versions in this module Expand all Collapse all v3 v3.0.1 Dec 12, 2020 v3.0.0 Dec 7, 2020 Changes in this version + type Agent interface + Close func() + GetSession func() *rpc.Session + LocalAddr func() net.Addr + RemoteAddr func() net.Addr + SetUserData func(data interface{}) + UserData func() interface{} + Write func(data *[]byte) + type ChannelRemote struct + func NewChannelRemote(conn Connector) *ChannelRemote + func (c *ChannelRemote) Broadcast(ctx context.Context, args *rpc.ArgsGroup, reply *rpc.ReplyGroup) error + func (c *ChannelRemote) PushMessageByGroup(ctx context.Context, args *rpc.ArgsGroup, reply *rpc.ReplyGroup) error + type Connection interface + OnDisconnect func(session *rpc.Session) + type Connector interface + GetSessionMap func() *SessionMap + type SessionMap struct + func (s *SessionMap) AddSession(a Agent) + func (s *SessionMap) DelSession(a Agent) + func (s *SessionMap) GetAgent(sessionId int64) (Agent, error) + func (s *SessionMap) GetSessionCount() int32 + func (s *SessionMap) Range(f func(k, v interface{}) bool) + type SessionRemote struct + func NewSessionRemote(c Connector) *SessionRemote + func (s *SessionRemote) Bind(ctx context.Context, args *rpc.Args, reply *rpc.Reply) error + func (s *SessionRemote) GetSessionCount(ctx context.Context, args *rpc.Args, reply *rpc.Reply) error + func (s *SessionRemote) KickBySid(ctx context.Context, args *rpc.Args, reply *rpc.Reply) error + func (s *SessionRemote) Push(ctx context.Context, args *rpc.Args, reply *rpc.Reply) error + func (s *SessionRemote) UnBind(ctx context.Context, args *rpc.Args, reply *rpc.Reply) error + type TimeJob struct + type Timers struct + func NewTimer() *Timers + func (t *Timers) AfterFunc(d time.Duration, cb func()) *timer.Timer + func (t *Timers) ClearTimeout(handler *timer.Timer) + func (t *Timers) CronFunc(cronExpr *timer.CronExpr, cb func()) *timer.Cron + func (t *Timers) RunTimer(closeSig chan bool)