Documentation
¶
Index ¶
- type Config
- type Dao
- func (d *Dao) BroadcastMsg(c context.Context, op, speed int32, msg []byte) (err error)
- func (d *Dao) BroadcastRoomMsg(c context.Context, op int32, room string, msg []byte) (err error)
- func (d *Dao) Close() error
- func (d *Dao) Ping(c context.Context) error
- func (d *Dao) PushMsg(c context.Context, op int32, server string, keys []string, msg []byte) (err error)
- type NatsConfig
- type NatsDao
- func (d *NatsDao) AddMapping(c context.Context, mid int64, key, server string) (err error)
- func (d *NatsDao) AddServerOnline(c context.Context, server string, online *model.Online) (err error)
- func (d *NatsDao) DelMapping(c context.Context, mid int64, key, server string) (has bool, err error)
- func (d *NatsDao) DelServerOnline(c context.Context, server string) (err error)
- func (d *NatsDao) ExpireMapping(c context.Context, mid int64, key string) (has bool, err error)
- func (d *NatsDao) KeysByMids(c context.Context, mids []int64) (ress map[string]string, olMids []int64, err error)
- func (d *NatsDao) ServerOnline(c context.Context, server string) (online *model.Online, err error)
- func (d *NatsDao) ServersByKeys(c context.Context, keys []string) (res []string, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dao ¶
type Dao struct {
// contains filtered or unexported fields
}
NatsDao dao for nats
func (*Dao) BroadcastMsg ¶
BroadcastMsg push a message to databus.
func (*Dao) BroadcastRoomMsg ¶
BroadcastRoomMsg push a message to databus.
type NatsConfig ¶
type NatsConfig = Config
type NatsDao ¶
type NatsDao = Dao
func (*NatsDao) AddServerOnline ¶
func (d *NatsDao) AddServerOnline(c context.Context, server string, online *model.Online) (err error)
AddServerOnline add a server online.
func (*NatsDao) DelMapping ¶
func (d *NatsDao) DelMapping(c context.Context, mid int64, key, server string) (has bool, err error)
DelMapping del a mapping.
func (*NatsDao) DelServerOnline ¶
DelServerOnline del a server online.
func (*NatsDao) ExpireMapping ¶
ExpireMapping expire a mapping.
func (*NatsDao) KeysByMids ¶
func (d *NatsDao) KeysByMids(c context.Context, mids []int64) (ress map[string]string, olMids []int64, err error)
KeysByMids get a key server by mid.
func (*NatsDao) ServerOnline ¶
ServerOnline get a server online.
Click to show internal directories.
Click to hide internal directories.