Documentation
¶
Index ¶
- Constants
- Variables
- func EnqueueReply(queue Queue, value *pb.NoirReply) error
- func EnqueueRequest(queue Queue, value *pb.NoirRequest) error
- func FillDefaults(value *pb.NoirRequest)
- func GetRoomCleanupTime(data *pb.RoomData) time.Time
- func GetRoomEndTime(data *pb.RoomData) time.Time
- func GetUserCleanupTime(data *pb.UserData) time.Time
- func GetUserEndTime(data *pb.UserData) time.Time
- func MarshalReply(value *pb.NoirReply) ([]byte, error)
- func MarshalRequest(value *pb.NoirRequest) ([]byte, error)
- func ParseSDP(offer webrtc.SessionDescription) (*sdp.SessionDescription, error)
- func RandomString(length int) string
- func ReadAction(request *pb.NoirRequest) (string, error)
- func ReadAdminAction(admin *pb.AdminRequest) (string, error)
- func ReadSignalAction(signal *pb.SignalRequest) (string, error)
- func SaveRoomData(roomID string, data *pb.RoomData, m *Manager) error
- func StringWithCharset(length int, charset string) string
- func TrackSummary(desc *sdp.SessionDescription) (int, int, int, string)
- func UnmarshalRequest(message []byte, destination *pb.NoirRequest) error
- func ValidateHealthy(node *pb.NodeData) bool
- type Config
- type Job
- type JobHandler
- type Join
- type Manager
- func (m *Manager) BindRoomSession(room Room, session *sfu.Session) *Room
- func (m *Manager) Checkin() error
- func (m *Manager) ClaimRoomNode(roomID string, nodeID string) (bool, error)
- func (m *Manager) Cleanup()
- func (m *Manager) CloseRoom(roomID string)
- func (m *Manager) ConnectUser(signal *pb.SignalRequest) (*sfu.Peer, *pb.UserData, error)
- func (m *Manager) CountMatchingKeys(pattern string) (int64, error)
- func (m *Manager) CreateRoomIfNotExists(roomID string) (*pb.RoomData, error)
- func (m *Manager) DisconnectUser(userID string)
- func (m *Manager) FirstAvailableWorkerID(action string) (string, error)
- func (m *Manager) GetLocalRoom(roomID string) (*Room, error)
- func (m *Manager) GetQueue(topic string) Queue
- func (m *Manager) GetRemoteNodeData(nodeID string) (*pb.NodeData, error)
- func (m *Manager) GetRemoteRoomData(roomID string) (*pb.RoomData, error)
- func (m *Manager) GetRemoteRoomExists(roomID string) (bool, error)
- func (m *Manager) GetRemoteUserData(userID string) (*pb.UserData, error)
- func (m *Manager) GetRemoteWorkerQueue(id string) *Queue
- func (m *Manager) GetRouter() *Router
- func (m *Manager) GetWorker() *Worker
- func (m *Manager) ID() string
- func (m *Manager) LoadData(key string) (*pb.NoirObject, error)
- func (m *Manager) LookupSignalRoomID(signal *pb.SignalRequest) (string, error)
- func (m *Manager) MarkOffline(nodeID string)
- func (m *Manager) NodeCount() int
- func (m *Manager) Noir()
- func (m *Manager) RandomWorkerId() (string, error)
- func (m *Manager) RoomCount() int
- func (m *Manager) SFU() *NoirSFU
- func (m *Manager) SaveData(key string, status *pb.NoirObject, expiry time.Duration) error
- func (m *Manager) SetRouter(r *Router)
- func (m *Manager) SetWorker(w *Worker)
- func (m *Manager) UpdateAvailableNodes() error
- func (m *Manager) UpdateRoomScore(roomID string)
- func (m *Manager) ValidateHealthyNodeID(nodeID string) error
- func (m *Manager) ValidateOffer(room *pb.RoomData, userID string, offer webrtc.SessionDescription) (*sdp.SessionDescription, error)
- func (m *Manager) WorkerData(id string) *pb.NodeData
- func (m *Manager) WorkerForRoom(roomID string) (string, error)
- type Negotiation
- type NoirSFU
- type PeerJob
- func (j *PeerJob) GetFromPeerQueue() Queue
- func (j *PeerJob) GetPeerConnection() (*webrtc.PeerConnection, error)
- func (j *PeerJob) GetPeerData() *pb.PeerJobData
- func (j *PeerJob) GetPeerQueue() Queue
- func (j *PeerJob) Kill(code int)
- func (j *PeerJob) KillWithError(err error)
- func (j *PeerJob) SendJoin() error
- type Queue
- type Room
- type Router
- type RunnableJob
- type User
- type Worker
Constants ¶
View Source
const ( ManagerPingFrequency = 10 * time.Second QueueMessageTimeout = 25 * time.Second )
View Source
const ( RouterTopic = "noir/" WebrtcTimeout = 25 * time.Second RouterMaxAge = WebrtcTimeout )
Variables ¶
View Source
var (
SESSION_TIMEOUT = 10 * time.Second
)
Functions ¶
func EnqueueRequest ¶
func EnqueueRequest(queue Queue, value *pb.NoirRequest) error
func FillDefaults ¶
func FillDefaults(value *pb.NoirRequest)
func MarshalRequest ¶
func MarshalRequest(value *pb.NoirRequest) ([]byte, error)
func ParseSDP ¶ added in v0.2.1
func ParseSDP(offer webrtc.SessionDescription) (*sdp.SessionDescription, error)
func RandomString ¶
func ReadAction ¶
func ReadAction(request *pb.NoirRequest) (string, error)
func ReadAdminAction ¶ added in v0.2.7
func ReadAdminAction(admin *pb.AdminRequest) (string, error)
func ReadSignalAction ¶
func ReadSignalAction(signal *pb.SignalRequest) (string, error)
func SaveRoomData ¶ added in v0.2.1
func StringWithCharset ¶
func TrackSummary ¶ added in v0.2.5
func UnmarshalRequest ¶
func UnmarshalRequest(message []byte, destination *pb.NoirRequest) error
func ValidateHealthy ¶ added in v0.2.1
Types ¶
type Job ¶ added in v0.2.7
type Job struct {
// contains filtered or unexported fields
}
func NewBaseJob ¶ added in v0.2.7
func (*Job) GetCommandQueue ¶ added in v0.2.7
func (*Job) GetManager ¶ added in v0.2.7
func (*Job) KillWithError ¶ added in v0.2.7
type JobHandler ¶ added in v0.2.7
type JobHandler func(request *pb.NoirRequest) RunnableJob
type Join ¶ added in v0.2.1
type Join struct { Sid string `json:"sid"` Offer webrtc.SessionDescription `json:"offer"` }
Join message sent when initializing a peer connection
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewRedisManager ¶
func NewTestSetup ¶
func (*Manager) BindRoomSession ¶ added in v0.2.1
func (*Manager) ClaimRoomNode ¶
func (*Manager) ConnectUser ¶ added in v0.2.1
func (*Manager) CountMatchingKeys ¶ added in v0.2.7
func (*Manager) CreateRoomIfNotExists ¶ added in v0.2.1
func (*Manager) DisconnectUser ¶ added in v0.2.1
func (*Manager) FirstAvailableWorkerID ¶
func (*Manager) GetRemoteNodeData ¶ added in v0.2.1
func (*Manager) GetRemoteRoomData ¶ added in v0.2.1
func (*Manager) GetRemoteRoomExists ¶
func (*Manager) GetRemoteUserData ¶ added in v0.2.1
func (*Manager) GetRemoteWorkerQueue ¶
func (*Manager) LoadData ¶ added in v0.2.1
func (m *Manager) LoadData(key string) (*pb.NoirObject, error)
func (*Manager) LookupSignalRoomID ¶
func (m *Manager) LookupSignalRoomID(signal *pb.SignalRequest) (string, error)
func (*Manager) MarkOffline ¶
func (*Manager) Noir ¶
func (m *Manager) Noir()
The Noir thread launches the worker and router, and then handles ticker tasks (update cluster health, print status) and watches for the quit servers to cleanup
func (*Manager) RandomWorkerId ¶
func (*Manager) UpdateAvailableNodes ¶ added in v0.2.1
func (*Manager) UpdateRoomScore ¶ added in v0.2.7
func (*Manager) ValidateHealthyNodeID ¶ added in v0.2.1
func (*Manager) ValidateOffer ¶ added in v0.2.1
type Negotiation ¶ added in v0.2.1
type Negotiation struct {
Desc webrtc.SessionDescription `json:"desc"`
}
Negotiation message sent when renegotiating the peer connection
type NoirSFU ¶
type NoirSFU interface { sfu.SessionProvider AttachManager(*Manager) }
func NewNoirSFU ¶
NewNoirSFU will create an object that represent the NoirSFU interface
type PeerJob ¶ added in v0.2.7
type PeerJob struct { Job // contains filtered or unexported fields }
func NewPeerJob ¶ added in v0.2.7
func (*PeerJob) GetFromPeerQueue ¶ added in v0.2.7
func (*PeerJob) GetPeerConnection ¶ added in v0.2.7
func (*PeerJob) GetPeerData ¶ added in v0.2.7
func (j *PeerJob) GetPeerData() *pb.PeerJobData
func (*PeerJob) GetPeerQueue ¶ added in v0.2.7
func (*PeerJob) KillWithError ¶ added in v0.3.0
type Queue ¶
type Queue interface { Add(value []byte) error Next() ([]byte, error) BlockUntilNext(timeout time.Duration) ([]byte, error) Count() (int64, error) Cleanup() error Topic() string }
func NewListQueue ¶
func NewRedisQueue ¶
type Room ¶
type Room struct {
// contains filtered or unexported fields
}
func NewChannel ¶ added in v0.2.1
A Channel is a Room with isChannel=true, only allows 1 publisher
func (*Room) LatestData ¶ added in v0.2.1
func (*Room) SetOptions ¶ added in v0.2.1
func (r *Room) SetOptions(options *pb.RoomOptions)
func (*Room) UpdateData ¶ added in v0.2.1
type Router ¶
type Router interface { HandleForever() GetQueue() *Queue HandleNext() error Handle(*pb.NoirRequest) error NextCommand() (*pb.NoirRequest, error) }
type RunnableJob ¶ added in v0.2.7
type RunnableJob interface {
Handle()
}
type User ¶ added in v0.2.1
User represent the User model
Source Files
¶
Click to show internal directories.
Click to hide internal directories.