Documentation
¶
Index ¶
- Constants
- func GetDefaultUDPListeningSocketsCount() int
- type ICEHostPortOverride
- type ICEServerConfig
- type ICEServers
- type Message
- type MessageType
- type Metrics
- type RateMonitor
- type Server
- func (s *Server) CloseSession(sessionID string) error
- func (s *Server) GetSessionConfig(groupID, callID, sessionID string) (SessionConfig, error)
- func (s *Server) GetSessionConfigs(groupID, callID string) ([]SessionConfig, error)
- func (s *Server) InitSession(cfg SessionConfig, closeCb func() error) error
- func (s *Server) NewLogger(_ string) logging.LeveledLogger
- func (s *Server) ReceiveCh() <-chan Message
- func (s *Server) Send(msg Message) error
- func (s *Server) Start() error
- func (s *Server) Stop() error
- type ServerConfig
- type SessionConfig
- type SessionProps
- type TURNConfig
Constants ¶
View Source
const ( SimulcastLevelHigh = "h" SimulcastLevelLow = "l" SimulcastLevelDefault = SimulcastLevelLow )
View Source
const MaxTURNCredentialsExpiration = 7 * 24 * 60 // 1 week in minutes
View Source
const (
ScreenTrackMimeTypeDefault = webrtc.MimeTypeVP8
)
Variables ¶
This section is empty.
Functions ¶
func GetDefaultUDPListeningSocketsCount ¶ added in v1.0.0
func GetDefaultUDPListeningSocketsCount() int
Types ¶
type ICEHostPortOverride ¶ added in v0.15.0
type ICEHostPortOverride string
func (*ICEHostPortOverride) IsValid ¶ added in v0.15.0
func (s *ICEHostPortOverride) IsValid() error
func (*ICEHostPortOverride) ParseMap ¶ added in v0.15.0
func (s *ICEHostPortOverride) ParseMap() (map[string]int, error)
func (*ICEHostPortOverride) SinglePort ¶ added in v0.15.0
func (s *ICEHostPortOverride) SinglePort() int
func (*ICEHostPortOverride) UnmarshalTOML ¶ added in v0.15.0
func (s *ICEHostPortOverride) UnmarshalTOML(data interface{}) error
type ICEServerConfig ¶ added in v0.6.7
type ICEServerConfig struct { URLs []string `toml:"urls" json:"urls"` Username string `toml:"username,omitempty" json:"username,omitempty"` Credential string `toml:"credential,omitempty" json:"credential,omitempty"` }
func (ICEServerConfig) IsSTUN ¶ added in v0.6.8
func (c ICEServerConfig) IsSTUN() bool
func (ICEServerConfig) IsTURN ¶ added in v0.6.8
func (c ICEServerConfig) IsTURN() bool
func (ICEServerConfig) IsValid ¶ added in v0.6.7
func (c ICEServerConfig) IsValid() error
type ICEServers ¶ added in v0.6.7
type ICEServers []ICEServerConfig
func GenTURNConfigs ¶ added in v0.6.8
func GenTURNConfigs(turnServers ICEServers, username, secret string, expiryMinutes int) (ICEServers, error)
func (*ICEServers) Decode ¶ added in v0.6.7
func (s *ICEServers) Decode(value string) error
func (ICEServers) IsValid ¶ added in v0.6.7
func (s ICEServers) IsValid() error
func (*ICEServers) UnmarshalTOML ¶ added in v0.6.7
func (s *ICEServers) UnmarshalTOML(data interface{}) error
type Message ¶
type MessageType ¶
type MessageType int
const ( ICEMessage MessageType = iota + 1 SDPMessage MuteMessage UnmuteMessage ScreenOnMessage ScreenOffMessage VoiceOnMessage VoiceOffMessage )
type Metrics ¶
type Metrics interface { IncRTCSessions(groupID string) DecRTCSessions(groupID string) IncRTCConnState(state string) IncRTCErrors(groupID string, errType string) IncRTPTracks(groupID string, direction, trackType string) DecRTPTracks(groupID string, direction, trackType string) ObserveRTPTracksWrite(groupID, trackType string, dur float64) ObserveRTCConnectionTime(groupID string, dur float64) ObserveRTCDataChannelOpenTime(groupID string, dur float64) ObserveRTCSignalingLockGrabTime(groupID string, dur float64) ObserveRTCSignalingLockLockedTime(groupID string, dur float64) // Client metrics ObserveRTCClientLossRate(groupID string, val float64) ObserveRTCClientRTT(groupID string, val float64) ObserveRTCClientJitter(groupID string, val float64) }
type RateMonitor ¶ added in v0.10.0
type RateMonitor struct {
// contains filtered or unexported fields
}
func NewRateMonitor ¶ added in v0.10.0
func (*RateMonitor) GetSamplesDuration ¶ added in v0.10.0
func (m *RateMonitor) GetSamplesDuration() time.Duration
func (*RateMonitor) PushSample ¶ added in v0.10.0
func (m *RateMonitor) PushSample(size int)
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func NewServer ¶
func NewServer(cfg ServerConfig, log mlog.LoggerIFace, metrics Metrics) (*Server, error)
func (*Server) CloseSession ¶
func (*Server) GetSessionConfig ¶ added in v1.0.0
func (s *Server) GetSessionConfig(groupID, callID, sessionID string) (SessionConfig, error)
func (*Server) GetSessionConfigs ¶ added in v1.0.0
func (s *Server) GetSessionConfigs(groupID, callID string) ([]SessionConfig, error)
func (*Server) InitSession ¶
func (s *Server) InitSession(cfg SessionConfig, closeCb func() error) error
type ServerConfig ¶
type ServerConfig struct { // ICEAddressUDP specifies the UDP address the RTC service should listen on. ICEAddressUDP string `toml:"ice_address_udp"` // ICEPortUDP specifies the UDP port the RTC service should listen to. ICEPortUDP int `toml:"ice_port_udp"` // ICEAddressTCP specifies the TCP address the RTC service should listen on. ICEAddressTCP string `toml:"ice_address_tcp"` // ICEPortTCP specifies the TCP port the RTC service should listen to. ICEPortTCP int `toml:"ice_port_tcp"` // ICEHostOverride optionally specifies an IP address (or hostname) // to be used as the main host ICE candidate. ICEHostOverride string `toml:"ice_host_override"` // ICEHostPortOverride optionally specifies a port number to override the one // used to listen on when sharing host candidates. ICEHostPortOverride ICEHostPortOverride `toml:"ice_host_port_override"` // A list of ICE server (STUN/TURN) configurations to use. ICEServers ICEServers `toml:"ice_servers"` TURNConfig TURNConfig `toml:"turn"` // EnableIPv6 specifies whether or not IPv6 should be used. EnableIPv6 bool `toml:"enable_ipv6"` // UDPSocketsCount controls the number of listening UDP sockets used for each local // network address. A larger number can improve performance by reducing contention // over a few file descriptors. At the same time, it will cause more file descriptors // to be open. The default is a dynamic value that scales with the number of available CPUs with // a constant multiplier of 100. E.g. On a 4 CPUs node, 400 sockets per local // network address will be open. UDPSocketsCount int `toml:"udp_sockets_count"` }
func (ServerConfig) IsValid ¶
func (c ServerConfig) IsValid() error
type SessionConfig ¶
type SessionConfig struct { // GroupID specifies the id of the group the session should belong to. GroupID string // CallID specifies the id of the call the session should belong to. CallID string // UserID specifies the id of the user the session belongs to. UserID string // SessionID specifies the unique identifier for the session. SessionID string // Props specifies some properties for the session. Props SessionProps }
func (*SessionConfig) FromMap ¶ added in v0.17.0
func (c *SessionConfig) FromMap(m map[string]any) error
func (SessionConfig) IsValid ¶
func (c SessionConfig) IsValid() error
type SessionProps ¶ added in v0.17.0
func (SessionProps) AV1Support ¶ added in v0.17.0
func (p SessionProps) AV1Support() bool
func (SessionProps) ChannelID ¶ added in v0.17.0
func (p SessionProps) ChannelID() string
func (SessionProps) DCSignaling ¶ added in v0.18.0
func (p SessionProps) DCSignaling() bool
type TURNConfig ¶ added in v0.6.8
type TURNConfig struct { // The secret key used to generate TURN short-lived authentication // credentials. StaticAuthSecret string `toml:"static_auth_secret"` // The number of minutes that the generated TURN credentials will be valid for. CredentialsExpirationMinutes int `toml:"credentials_expiration_minutes"` }
func (TURNConfig) IsValid ¶ added in v0.6.8
func (c TURNConfig) IsValid() error
Source Files
¶
Click to show internal directories.
Click to hide internal directories.