Documentation ¶
Index ¶
- Variables
- func AgreeHandler(w http.ResponseWriter, r *http.Request)
- func GetListHandler(w http.ResponseWriter, r *http.Request)
- func GetMemberHandler(w http.ResponseWriter, r *http.Request)
- func GetRecommendUserHandler(w http.ResponseWriter, r *http.Request)
- func GetUserRow(db *sql.DB, sid string) map[string]string
- func InitGlobalGroup()
- func InitHandler()
- func InitReqHubPool(to_hub []string)
- func JoinChannel(db *sql.DB, uid int, sid string)
- func LoginHandler(w http.ResponseWriter, r *http.Request)
- func RegHandler(w http.ResponseWriter, r *http.Request)
- func RejectHandler(w http.ResponseWriter, r *http.Request)
- func ReqAddFriendHandler(w http.ResponseWriter, r *http.Request)
- func ReqAddGroupHandler(w http.ResponseWriter, r *http.Request)
- func SystemMsgHandler(w http.ResponseWriter, r *http.Request)
- func UploadFileHandler(w http.ResponseWriter, r *http.Request)
- func UploadImageHandler(w http.ResponseWriter, r *http.Request)
- type AfterWorkCallback
- type FriendType
- type ListType
- type MemberType
- type PushReqHub
- type ReturnType
- type Root
- type Sdk
- func (sdk *Sdk) AddCron(expression string, exefnc func()) bool
- func (sdk *Sdk) AreaAddSid(sid string, area_id string) bool
- func (sdk *Sdk) AreaKickSid(sid string, area_id string) bool
- func (sdk *Sdk) BroadcastAll(msg []byte) bool
- func (sdk *Sdk) Broatcast(sid string, area_id string, data []byte) bool
- func (sdk *Sdk) CreateArea(id string, name string) bool
- func (sdk *Sdk) Disable() bool
- func (sdk *Sdk) Enable() bool
- func (sdk *Sdk) Get(key string) string
- func (sdk *Sdk) GetAllSession() string
- func (sdk *Sdk) GetAreas() map[string]string
- func (sdk *Sdk) GetAreasKey() []string
- func (sdk *Sdk) GetAreasStr() string
- func (sdk *Sdk) GetBase() string
- func (sdk *Sdk) GetEnableStatus() bool
- func (sdk *Sdk) GetSession(sid string) string
- func (sdk *Sdk) GetSessionType(sid string) *area.Session
- func (sdk *Sdk) GetSidsByArea(channel_id string) string
- func (sdk *Sdk) GetUserJoinedAreas(sid string) string
- func (sdk *Sdk) Init(_type string, req_header *protocol.ReqHeader, data []byte) *Sdk
- func (sdk *Sdk) InitCmd(cmd string, sid string, reqid int, data []byte) *Sdk
- func (sdk *Sdk) Kick(sid string) bool
- func (sdk *Sdk) Push(from_sid string, to_sid string, to_data []byte) bool
- func (sdk *Sdk) PushBySids(from_sid string, to_sids []string, data []byte) bool
- func (sdk *Sdk) PushHub(req_cmd string, data []byte) bool
- func (sdk *Sdk) RemoveArea(id string) bool
- func (sdk *Sdk) RemoveCron(expression string) bool
- func (sdk *Sdk) ReqHub(req_cmd string, data []byte) (string, bool)
- func (sdk *Sdk) ReqHubAsync(req_cmd string, data []byte, handler AfterWorkCallback) (string, bool)
- func (sdk *Sdk) Set(key string, value string, expire int) bool
- func (sdk *Sdk) UpdateSession(sid string, data string) bool
- type SysMsgType
- type TaskType
- func (this TaskType) Auth() ReturnType
- func (this TaskType) Authorize() ReturnType
- func (this TaskType) Broadcast() string
- func (this TaskType) GetAreas() string
- func (this TaskType) GetBase(conn *net.TCPConn, cmd string, req_sid string, req_id int, req_data string) string
- func (this TaskType) GetUserSession() string
- func (this *TaskType) Init(conn *net.TCPConn, req_obj *protocol.ReqRoot) *TaskType
- func (this TaskType) JoinArea() string
- func (this TaskType) KickSelf() interface{}
- func (this TaskType) LeaveChannel() interface{}
- func (this TaskType) Message() string
- func (this TaskType) Push() string
- func (this TaskType) PushGroupMessage() string
- func (this TaskType) PushMessage() string
- func (this TaskType) SubscripeGroup() ReturnType
- func (this TaskType) Update() string
- func (this *TaskType) WsInit(wsconn *websocket.Conn, req_obj *protocol.ReqRoot) *TaskType
Constants ¶
This section is empty.
Variables ¶
View Source
var InitialCap int
View Source
var ReqHubConns = make([]*net.TCPConn, 0)
View Source
var ReqSeqCallbacks *syncmap.SyncMap
View Source
var ToHub []string
Functions ¶
func AgreeHandler ¶
func AgreeHandler(w http.ResponseWriter, r *http.Request)
func GetListHandler ¶
func GetListHandler(w http.ResponseWriter, r *http.Request)
func GetMemberHandler ¶
func GetMemberHandler(w http.ResponseWriter, r *http.Request)
func GetRecommendUserHandler ¶
func GetRecommendUserHandler(w http.ResponseWriter, r *http.Request)
func InitReqHubPool ¶
func InitReqHubPool(to_hub []string)
func LoginHandler ¶
func LoginHandler(w http.ResponseWriter, r *http.Request)
func RegHandler ¶
func RegHandler(w http.ResponseWriter, r *http.Request)
func RejectHandler ¶
func RejectHandler(w http.ResponseWriter, r *http.Request)
func ReqAddFriendHandler ¶
func ReqAddFriendHandler(w http.ResponseWriter, r *http.Request)
func ReqAddGroupHandler ¶
func ReqAddGroupHandler(w http.ResponseWriter, r *http.Request)
func SystemMsgHandler ¶
func SystemMsgHandler(w http.ResponseWriter, r *http.Request)
func UploadFileHandler ¶
func UploadFileHandler(w http.ResponseWriter, r *http.Request)
func UploadImageHandler ¶
func UploadImageHandler(w http.ResponseWriter, r *http.Request)
Types ¶
type AfterWorkCallback ¶
type FriendType ¶
type ListType ¶
type ListType struct { Mine map[string]string `json:"mine"` Friend []FriendType `json:"friend"` Group []map[string]string `json:"group"` }
type MemberType ¶
type ReturnType ¶
type Sdk ¶
type Sdk struct { Connected bool HubConn *net.TCPConn ReqType string ReqHeader *protocol.ReqHeader Data []byte }
func (*Sdk) BroadcastAll ¶
func (*Sdk) GetAllSession ¶
func (*Sdk) GetAreasKey ¶
func (*Sdk) GetAreasStr ¶
func (*Sdk) GetSession ¶
func (*Sdk) GetSidsByArea ¶
func (*Sdk) GetUserJoinedAreas ¶
func (*Sdk) PushBySids ¶
func (*Sdk) RemoveArea ¶
func (*Sdk) RemoveCron ¶
func (*Sdk) ReqHubAsync ¶
向Hub请求数据并监听返回,该请求将会阻塞除非等待返回超时
type SysMsgType ¶
type SysMsgType struct { Id int64 `json:"id"` Content string `json:"content"` Username string `json:"username"` Uid int64 `json:"uid"` From int64 `json:"from"` From_group int64 `json:"from_group"` Type int64 `json:"type"` Href string `json:"href"` Read int64 `json:"read"` Remark string `json:"remark"` Time string `json:"time"` Status int64 `json:"status"` User map[string]string `json:"user"` }
type TaskType ¶
type TaskType struct { Conn *net.TCPConn WsConn *websocket.Conn ReqType string ReqHeader *protocol.ReqHeader Data []byte }
func (TaskType) Auth ¶
func (this TaskType) Auth() ReturnType
func (TaskType) Authorize ¶
func (this TaskType) Authorize() ReturnType
func (TaskType) GetUserSession ¶
func (TaskType) LeaveChannel ¶
func (this TaskType) LeaveChannel() interface{}
func (TaskType) PushGroupMessage ¶
func (TaskType) PushMessage ¶
func (TaskType) SubscripeGroup ¶
func (this TaskType) SubscripeGroup() ReturnType
Click to show internal directories.
Click to hide internal directories.