Documentation
¶
Index ¶
- Constants
- func CandidateForJSON(c webrtc.ICECandidateInit) webrtc.ICECandidateInit
- func GetPubMediaPath(rid, mid string, ssrc uint32) string
- func GetPubMediaPathKey(rid string) string
- func GetPubNodePath(rid, uid string) string
- func Marshal(v interface{}) ([]byte, error)
- func MarshalNodeField(node NodeInfo) (string, string, error)
- func MarshalTrackField(id string, infos []TrackInfo) (string, string, error)
- func Unmarshal(data []byte, v interface{}) error
- func UnmarshalTrackField(key string, value string) (string, *[]TrackInfo, error)
- type Authenticatable
- type ClientAnswerMsg
- type ClientOfferMsg
- type ClientTrickleMsg
- type FromClientBroadcastMsg
- type FromClientJoinMsg
- type FromClientLeaveMsg
- type FromIslbFindNodeMsg
- type FromIslbListMids
- type FromIslbPeerJoinMsg
- type FromIslbStreamAddMsg
- type FromSfuJoinMsg
- type IslbBroadcastMsg
- type IslbPeerLeaveMsg
- type MID
- type MediaInfo
- type MsgHandler
- type NatsRPC
- func (r *NatsRPC) Close()
- func (r *NatsRPC) Connect(url string) error
- func (r *NatsRPC) Publish(subj string, data interface{}) error
- func (r *NatsRPC) QueueSubscribe(subj, queue string, handle MsgHandler) (*nats.Subscription, error)
- func (r *NatsRPC) Request(subj string, data interface{}) (interface{}, error)
- func (r *NatsRPC) Subscribe(subj string, handle MsgHandler) (*nats.Subscription, error)
- type NodeInfo
- type Peer
- type RID
- type RPCError
- type RoomInfo
- type RoomToken
- type SfuAnswerMsg
- type SfuICEConnectionStateMsg
- type SfuOfferMsg
- type SfuTrickleMsg
- type Stream
- type StreamID
- type ToAvpProcessMsg
- type ToClientBroadcastMsg
- type ToClientJoinMsg
- type ToClientPeerJoinMsg
- type ToClientPeersMsg
- type ToIslbFindNodeMsg
- type ToIslbPeerJoinMsg
- type ToIslbStreamAddMsg
- type ToSfuJoinMsg
- type ToSfuLeaveMsg
- type TrackInfo
- type TrackMap
- type UID
- type UserInfo
Constants ¶
const ( // client to ion ClientJoin = "join" ClientLeave = "leave" ClientPublish = "publish" ClientUnPublish = "unpublish" ClientSubscribe = "subscribe" ClientUnSubscribe = "unsubscribe" ClientBroadcast = "broadcast" ClientTrickle = "trickle" ClientOffer = "offer" ClientAnswer = "answer" // ion to client ClientOnJoin = "peer-join" ClientOnLeave = "peer-leave" ClientOnList = "peer-list" ClientOnStreamAdd = "stream-add" ClientOnStreamRemove = "stream-remove" ClientOnOffer = "offer" ClientOnAnswer = "answer" // ion to islb IslbFindNode = "find-node" IslbRelay = "relay" IslbUnrelay = "unRelay" IslbKeepAlive = "keepAlive" IslbPeerJoin = ClientOnJoin IslbPeerLeave = ClientOnLeave IslbStreamAdd = ClientOnStreamAdd IslbBroadcast = ClientBroadcast // SFU Endpoints SfuTrickleICE = ClientTrickle SfuClientJoin = ClientJoin SfuClientOffer = ClientOnOffer SfuClientAnswer = ClientOnAnswer SfuClientTrickle = ClientTrickle SfuClientLeave = ClientLeave // avp AvpProcess = "avp-process" IslbID = "islb" )
Variables ¶
This section is empty.
Functions ¶
func CandidateForJSON ¶ added in v1.5.0
func CandidateForJSON(c webrtc.ICECandidateInit) webrtc.ICECandidateInit
CandidateForJSON for json.Marshal() => browser
func GetPubMediaPath ¶
func GetPubMediaPathKey ¶
func GetPubNodePath ¶
func MarshalNodeField ¶ added in v0.2.0
func MarshalTrackField ¶ added in v0.2.0
Types ¶
type Authenticatable ¶ added in v1.5.0
type ClientAnswerMsg ¶ added in v1.5.0
type ClientAnswerMsg struct {
Desc webrtc.SessionDescription `json:"desc"`
}
type ClientOfferMsg ¶ added in v1.5.0
type ClientOfferMsg struct {
Desc webrtc.SessionDescription `json:"desc"`
}
type ClientTrickleMsg ¶ added in v1.5.0
type ClientTrickleMsg struct {
Candidate webrtc.ICECandidateInit `json:"candidate"`
Target int `json:"target"`
}
type FromClientBroadcastMsg ¶ added in v1.5.0
type FromClientBroadcastMsg struct {
RID RID `json:"rid"`
Info json.RawMessage `json:"info"`
}
type FromClientJoinMsg ¶ added in v1.5.0
type FromClientJoinMsg struct {
RID RID `json:"sid"`
Offer webrtc.SessionDescription `json:"offer"`
RoomToken
Info json.RawMessage `json:"info"`
}
func (*FromClientJoinMsg) Room ¶ added in v1.5.0
func (j *FromClientJoinMsg) Room() RID
func (*FromClientJoinMsg) Token ¶ added in v1.5.0
func (j *FromClientJoinMsg) Token() string
type FromClientLeaveMsg ¶ added in v1.5.0
type FromClientLeaveMsg struct {
RID RID `json:"rid"`
}
type FromIslbFindNodeMsg ¶ added in v1.5.0
type FromIslbFindNodeMsg struct {
ID string
}
type FromIslbListMids ¶ added in v1.5.0
type FromIslbListMids struct {
MIDs []MID `json:"mids"`
}
type FromIslbPeerJoinMsg ¶ added in v1.5.0
type FromIslbStreamAddMsg ¶ added in v1.5.0
type FromSfuJoinMsg ¶ added in v1.5.0
type FromSfuJoinMsg struct {
Answer webrtc.SessionDescription `json:"answer"`
}
type IslbBroadcastMsg ¶ added in v1.5.0
type IslbBroadcastMsg struct {
RoomInfo
Info json.RawMessage `json:"info"`
}
type IslbPeerLeaveMsg ¶ added in v1.5.0
type IslbPeerLeaveMsg struct {
RoomInfo
}
type MediaInfo ¶ added in v0.2.0
type MediaInfo struct {
// DC data center id
DC string `json:"dc,omitempty"`
// NID node id
NID string `json:"nid,omitempty"`
// RID room id
RID RID `json:"rid,omitempty"`
// UID user id
UID UID `json:"uid,omitempty"`
// MID media id
MID MID `json:"mid,omitempty"`
}
MediaInfo media detailed information dc/${nid}/${rid}/${uid}/media/pub/${mid} node1 origin node2 shadow msid [{ssrc: 1234, pt: 111, type:audio}] msid [{ssrc: 5678, pt: 96, type:video}]
func ParseMediaInfo ¶ added in v0.2.0
Parse dc1/sfu-tU2GInE5Lfuc/7485294b-9815-4888-83a5-631e77445b67/room1/media/pub/7e97c1e8-c80a-4c69-81b0-27efc83e6120
type MsgHandler ¶ added in v1.5.0
type MsgHandler func(msg interface{}) (interface{}, error)
MsgHandler is a callback function that processes messages delivered to asynchronous subscribers.
type NatsRPC ¶ added in v1.5.0
type NatsRPC struct {
// contains filtered or unexported fields
}
NatsRPC represents a rpc base nats
func NewNatsRPC ¶ added in v1.5.0
NewNatsRPC create a instanse and connect to nats server.
func (*NatsRPC) Close ¶ added in v1.5.0
func (r *NatsRPC) Close()
Close the connection to the server.
func (*NatsRPC) Publish ¶ added in v1.5.0
Publish publishes the data argument to the given subject. The data argument is left untouched and needs to be correctly interpreted on the receiver.
func (*NatsRPC) QueueSubscribe ¶ added in v1.5.0
func (r *NatsRPC) QueueSubscribe(subj, queue string, handle MsgHandler) (*nats.Subscription, error)
QueueSubscribe creates an asynchronous queue subscriber on the given subject. All subscribers with the same queue name will form the queue group and only one member of the group will be selected to receive any given message asynchronously.
func (*NatsRPC) Request ¶ added in v1.5.0
Request will send a request payload and deliver the response message, or an error, including a timeout if no message was received properly.
func (*NatsRPC) Subscribe ¶ added in v1.5.0
func (r *NatsRPC) Subscribe(subj string, handle MsgHandler) (*nats.Subscription, error)
Subscribe will express interest in the given subject. Messages will be delivered to the associated MsgHandler.
type NodeInfo ¶ added in v0.2.0
type Peer ¶ added in v1.5.0
type Peer struct {
UID UID `json:"uid"`
Info json.RawMessage `json:"info"`
}
type RPCError ¶ added in v1.5.0
type RPCError struct {
Err string
}
RPCError represents a error string for rpc
type SfuAnswerMsg ¶ added in v1.5.0
type SfuAnswerMsg struct {
MID MID `json:"mid"`
Desc webrtc.SessionDescription `json:"answer"`
}
type SfuICEConnectionStateMsg ¶ added in v1.5.2
type SfuICEConnectionStateMsg struct {
MID MID `json:"mid"`
State webrtc.ICEConnectionState `json:"state"`
}
type SfuOfferMsg ¶ added in v1.5.0
type SfuOfferMsg struct {
MID MID `json:"mid"`
Desc webrtc.SessionDescription `json:"offer"`
}
type SfuTrickleMsg ¶ added in v1.5.0
type SfuTrickleMsg struct {
MID MID `json:"mid"`
Candidate webrtc.ICECandidateInit `json:"candidate"`
Target int `json:"target"`
}
type ToAvpProcessMsg ¶ added in v1.5.0
type ToAvpProcessMsg struct {
Addr string `json:"Addr"`
PID string `json:"pid"`
RID string `json:"rid"`
TID string `json:"tid"`
EID string `json:"eid"`
Config []byte `json:"config"`
}
ToAvpProcessMsg .
type ToClientBroadcastMsg ¶ added in v1.5.0
type ToClientBroadcastMsg struct {
RoomInfo
Info json.RawMessage `json:"info"`
}
type ToClientJoinMsg ¶ added in v1.5.0
type ToClientJoinMsg struct {
Answer webrtc.SessionDescription `json:"answer"`
}
type ToClientPeerJoinMsg ¶ added in v1.5.0
type ToClientPeerJoinMsg struct {
UID UID `json:"uid"`
RID RID `json:"rid"`
Info json.RawMessage `json:"info"`
}
type ToClientPeersMsg ¶ added in v1.5.0
type ToIslbFindNodeMsg ¶ added in v1.5.0
type ToIslbPeerJoinMsg ¶ added in v1.5.0
type ToIslbPeerJoinMsg struct {
UID UID `json:"uid"`
RID RID `json:"rid"`
MID MID `json:"mid"`
Info json.RawMessage `json:"info"`
}
type ToIslbStreamAddMsg ¶ added in v1.5.0
type ToSfuJoinMsg ¶ added in v1.5.0
type ToSfuJoinMsg struct {
RID RID `json:"rid"`
MID MID `json:"mid"`
Offer webrtc.SessionDescription `json:"offer"`
}
type ToSfuLeaveMsg ¶ added in v1.5.0
type ToSfuLeaveMsg struct {
MID MID `json:"mid"`
}