Documentation ¶
Index ¶
- Variables
- func CronTest()
- func Get(key string) (string, error)
- func HubServer()
- func LoadSessionFromRedis()
- func NewPool(server, password string) *redis.Pool
- func RedisInit()
- func Set(key string, args ...interface{}) (bool, error)
- func TickSyncSession()
- func TickWorkerServer()
- type Api
- func (api *Api) AddCron(expression string, exefnc func()) bool
- func (api *Api) AreaAddSid(sid string, area_id string) bool
- func (api *Api) AreaKickSid(sid string, area_id string) bool
- func (this *Api) Broadcast(sid string, area_id string, msg []byte) bool
- func (api *Api) BroadcastAll(msg []byte) bool
- func (api *Api) CreateArea(id string, name string) bool
- func (api *Api) Disable() bool
- func (api *Api) Enable() bool
- func (api *Api) Get(key string) bool
- func (api *Api) GetAllSession() string
- func (api *Api) GetAreas() map[string]string
- func (api *Api) GetAreasKey() []string
- func (api *Api) GetBase() string
- func (api *Api) GetEnableStatus() bool
- func (api *Api) GetSession(sid string) string
- func (api *Api) GetSidsByArea(channel_id string) string
- func (api *Api) GetUserJoinedAreas(sid string) string
- func (api *Api) Kick(sid string) bool
- func (api *Api) Push(to_sid, from_sid string, data_buf []byte) bool
- func (api *Api) PushBySids(from_sid string, to_sids []string, data_buf []byte) bool
- func (api *Api) RemoveArea(id string) bool
- func (api *Api) RemoveCron(expression string) bool
- func (api *Api) Set(key string, value string) bool
- func (this *Api) UpdateSession(sid string, data string) bool
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Pool *redis.Pool RedisConn *redis.Conn )
Functions ¶
func LoadSessionFromRedis ¶
func LoadSessionFromRedis()
func TickSyncSession ¶
func TickSyncSession()
func TickWorkerServer ¶
func TickWorkerServer()
Types ¶
type Api ¶
type Api struct {
Init func()
}
func (*Api) BroadcastAll ¶
func (*Api) GetAllSession ¶
func (*Api) GetAreasKey ¶
func (*Api) GetEnableStatus ¶
func (*Api) GetSession ¶
func (*Api) GetSidsByArea ¶
func (*Api) GetUserJoinedAreas ¶
func (*Api) PushBySids ¶
func (*Api) RemoveArea ¶
func (*Api) RemoveCron ¶
Click to show internal directories.
Click to hide internal directories.