rtc

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2022 License: Apache-2.0 Imports: 16 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Message

type Message struct {
	Session SessionConfig
	Type    MessageType
	Data    []byte
}

func (*Message) IsValid

func (m *Message) IsValid() error

type MessageType

type MessageType int
const (
	ICEMessage MessageType = iota + 1
	SDPMessage
	MuteMessage
	UnmuteMessage
	ScreenOnMessage
	ScreenOffMessage
)

type Server

type Server struct {
	// contains filtered or unexported fields
}

func NewServer

func NewServer(cfg ServerConfig, log mlog.LoggerIFace) (*Server, error)

func (*Server) CloseSession

func (s *Server) CloseSession(cfg SessionConfig) error

func (*Server) InitSession

func (s *Server) InitSession(cfg SessionConfig) error

func (*Server) ReceiveCh

func (s *Server) ReceiveCh() <-chan Message

func (*Server) SendCh added in v0.1.0

func (s *Server) SendCh() chan<- Message

func (*Server) Start

func (s *Server) Start() error

func (*Server) Stop

func (s *Server) Stop() error

type ServerConfig

type ServerConfig struct {
	// ICEPortUDP specifies the UDP port the RTC service should listen to.
	ICEPortUDP int `toml:"ice_port_udp"`
	// ICEHostOverride optionally specifies an IP address (or hostname)
	// to be used as the main host ICE candidate.
	ICEHostOverride string `toml:"ice_host_override"`
}

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
}

func (SessionConfig) IsValid

func (c SessionConfig) IsValid() error

Jump to

Keyboard shortcuts

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