Documentation ¶
Index ¶
- Constants
- func JoinChannelIds(uid string, channelIds ...string) error
- func NewServer(ctx *svc.ServiceContext, w http.ResponseWriter, r *http.Request, ...)
- func SendMessageToChannelIds(uid string, msg string, tp uint8, channelIds ...string) map[string]bool
- func SendMessageToUid(uid string, toUId uint64, msg string, tp uint8)
- func SendMessageToUids(uid string, msg string, tp uint8, toUIds ...uint64)
- func UnJoinChannelIds(uid uint64, channelIds ...string) error
- type Client
- type Hub
- type Message
- type ServerOptions
- type SingleMessage
- type ToErrMsg
- type ToSinglejsonMsg
- type TojsonMsg
Constants ¶
View Source
const ( SIGNAL_TYPE_JOIN = "join" SIGNAL_TYPE_RESP_JOIN = "resp-join" // 告知加入者对方是谁 SIGNAL_TYPE_LEAVE = "leave" SIGNAL_TYPE_NEW_PEER = "new-peer" SIGNAL_TYPE_PEER_LEAVE = "peer-leave" SIGNAL_TYPE_OFFER = "offer" SIGNAL_TYPE_ANSWER = "answer" SIGNAL_TYPE_CANDIDATE = "candidate" ERR_MSG = "err-msg" )
Variables ¶
This section is empty.
Functions ¶
func JoinChannelIds ¶
func NewServer ¶
func NewServer(ctx *svc.ServiceContext, w http.ResponseWriter, r *http.Request, clientId uint64, detail interface{})
func SendMessageToChannelIds ¶
func UnJoinChannelIds ¶
Types ¶
type Client ¶
type Client struct { Id uint64 Detail interface{} // contains filtered or unexported fields }
type Message ¶
type Message struct { ChannelId string `json:"channel_id"` // 管道ID ChannelTitle string `json:"channel_title"` // 管道标题 UserId uint64 `json:"user_id"` Detail interface{} `json:"detail"` ToUserId uint64 `json:"to_user_id"` Type uint8 `json:"type"` // 消息类型 Content string `json:"content"` // 消息内容 SendTime string `json:"send_time"` SingleMsg []byte `json:"single_msg""` //信令消息 }
type ServerOptions ¶
type SingleMessage ¶
type SingleMessage struct { Cmd string `json:"cmd"` RoomId string `json:"roomId"` Uid string `json:"uid"` RemoteUid string `json:"remoteUid"` Msg interface{} `json:"msg"` }
信令结构体
type ToSinglejsonMsg ¶
Click to show internal directories.
Click to hide internal directories.