chart

package
v1.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 3, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

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 JoinChannelIds(uid string, channelIds ...string) error

func NewServer

func NewServer(ctx *svc.ServiceContext, w http.ResponseWriter, r *http.Request, clientId uint64, detail interface{})

func SendMessageToChannelIds

func SendMessageToChannelIds(uid string, msg string, tp uint8, channelIds ...string) map[string]bool

func SendMessageToUid

func SendMessageToUid(uid string, toUId uint64, msg string, tp uint8)

func SendMessageToUids

func SendMessageToUids(uid string, msg string, tp uint8, toUIds ...uint64)

func UnJoinChannelIds

func UnJoinChannelIds(uid uint64, channelIds ...string) error

Types

type Client

type Client struct {
	Id     uint64
	Detail interface{}
	// contains filtered or unexported fields
}

func (*Client) ReadMsg

func (c *Client) ReadMsg()

func (*Client) WriteMsg

func (c *Client) WriteMsg()

type Hub

type Hub struct {
	// 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 ServerOptions struct {
	WriteWait       time.Duration
	PongWait        time.Duration
	PingPeriod      time.Duration
	MaxMessageSize  int64
	ReadBufferSize  int
	WriteBufferSize int
	BroadcastSize   int
}

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 ToErrMsg

type ToErrMsg struct {
	Cmd       string `json:"cmd"`
	RemoteUid string `json:"remoteUid"`
	Msg       string `json:"msg"`
}

type ToSinglejsonMsg

type ToSinglejsonMsg struct {
	Cmd       string `json:"cmd"`
	RemoteUid string `json:"remoteUid"`
}

type TojsonMsg

type TojsonMsg struct {
	Cmd       string `json:"cmd"`
	RemoteUid string `json:"remoteUid"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL