Documentation
¶
Index ¶
- Variables
- type BroadcastCreate
- type BroadcastEvent
- type BroadcastSession
- func (b *BroadcastSession) AddViewer(viewer *Viewer)
- func (b *BroadcastSession) Close(cause error)
- func (b *BroadcastSession) ContextClose() <-chan struct{}
- func (b *BroadcastSession) ListenEvent() <-chan BroadcastEvent
- func (b *BroadcastSession) MakeRTCConnection(config *config.Config)
- func (b *BroadcastSession) RemoveViewer(viewer *Viewer)
- func (b *BroadcastSession) SendEvent(event BroadcastEvent)
- func (b *BroadcastSession) SendEventToViewers(event ViewerEvent)
- func (b *BroadcastSession) SetTrack(trackChan <-chan *webrtc.TrackLocalStaticRTP)
- type BroadcastUpdate
- type BroadcastsRepository
- type BroadcastsUsecases
- type Viewer
- type ViewerCreate
- type ViewerEvent
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type BroadcastCreate ¶
type BroadcastCreate struct {
Title string
}
type BroadcastEvent ¶ added in v0.0.12
type BroadcastSession ¶
type BroadcastSession struct { Track *webrtc.TrackLocalStaticRTP Viewers map[*Viewer]struct{} EventOut chan BroadcastEvent EventIn chan BroadcastEvent ID string Title string // contains filtered or unexported fields }
func (*BroadcastSession) AddViewer ¶
func (b *BroadcastSession) AddViewer(viewer *Viewer)
func (*BroadcastSession) Close ¶
func (b *BroadcastSession) Close(cause error)
func (*BroadcastSession) ContextClose ¶
func (b *BroadcastSession) ContextClose() <-chan struct{}
func (*BroadcastSession) ListenEvent ¶ added in v0.0.12
func (b *BroadcastSession) ListenEvent() <-chan BroadcastEvent
func (*BroadcastSession) MakeRTCConnection ¶ added in v0.0.12
func (b *BroadcastSession) MakeRTCConnection(config *config.Config)
func (*BroadcastSession) RemoveViewer ¶
func (b *BroadcastSession) RemoveViewer(viewer *Viewer)
func (*BroadcastSession) SendEvent ¶ added in v0.0.12
func (b *BroadcastSession) SendEvent(event BroadcastEvent)
func (*BroadcastSession) SendEventToViewers ¶ added in v0.0.13
func (b *BroadcastSession) SendEventToViewers(event ViewerEvent)
func (*BroadcastSession) SetTrack ¶ added in v0.0.12
func (b *BroadcastSession) SetTrack(trackChan <-chan *webrtc.TrackLocalStaticRTP)
type BroadcastUpdate ¶
type BroadcastUpdate struct {
Title string
}
type BroadcastsRepository ¶
type BroadcastsRepository interface { GetBroadcast(id string) (*BroadcastSession, error) GetBroadcasts() ([]*BroadcastSession, error) CreateBroadcast(broadcast BroadcastCreate) (*BroadcastSession, error) UpdateBroadcast(id string, broadcast BroadcastUpdate) (*BroadcastSession, error) DeleteBroadcast(id string) error // Viewer related repository methods GetViewer(id string) (*Viewer, error) CreateViewer(viewer ViewerCreate) (*Viewer, error) DeleteViewer(id string) error }
type BroadcastsUsecases ¶
type BroadcastsUsecases interface { Get(id string) (*BroadcastSession, error) GetBroadcasts() ([]*BroadcastSession, error) Create(broadcastTitle string) (*BroadcastSession, error) SaveICECandidate(id string, candidate any) error SaveOffer(id, sdp string) (string, error) Delete(id string) error // Viewer related use cases Connect(broadcastId string) (*Viewer, error) SaveViewerICECandidate(broadcastId string, candidate any) error SaveViewerOffer(broadcastId, sdp string) (string, error) DeleteViewer(viewerId string) error }
FIXME: Use cases should receive a context.Context to handle timeouts and cancellations.
type Viewer ¶
type Viewer struct { EventOut chan ViewerEvent EventIn chan ViewerEvent BroadcastID string ID string // contains filtered or unexported fields }
func (*Viewer) ContextClose ¶ added in v0.0.13
func (v *Viewer) ContextClose() <-chan struct{}
func (*Viewer) HandleViewer ¶ added in v0.0.13
func (*Viewer) ListenEvent ¶ added in v0.0.13
func (v *Viewer) ListenEvent() <-chan ViewerEvent
func (*Viewer) SendEvent ¶ added in v0.0.13
func (v *Viewer) SendEvent(event ViewerEvent)
type ViewerCreate ¶ added in v0.1.0
type ViewerCreate struct {
BroadcastID string
}
type ViewerEvent ¶ added in v0.0.13
Click to show internal directories.
Click to hide internal directories.