Documentation
¶
Index ¶
- Variables
- type Hub
- type Item
- type RtpEngine
- type Session
- func (s *Session) CreateEgressEndpoint(ctx context.Context, offer *webrtc.SessionDescription, ...) (*webrtc.SessionDescription, error)
- func (s *Session) CreateIngressEndpoint(ctx context.Context, offer *webrtc.SessionDescription, ...) (*webrtc.SessionDescription, error)
- func (s *Session) OfferEgressEndpoint(ctx context.Context, signalKind SignalChannelKind) (*webrtc.SessionDescription, error)
- func (s *Session) OfferIngressEndpoint(ctx context.Context, signalKind SignalChannelKind) (*webrtc.SessionDescription, error)
- func (s *Session) SetEgressAnswer(answer *webrtc.SessionDescription) chan struct{}
- func (s *Session) SetIngressAnswer(answer *webrtc.SessionDescription) chan struct{}
- type SessionRepository
- func (r *SessionRepository) Add(s *Session)
- func (r *SessionRepository) All() map[uuid.UUID]*Session
- func (r *SessionRepository) Contains(id uuid.UUID) bool
- func (r *SessionRepository) Delete(id uuid.UUID) bool
- func (r *SessionRepository) DeleteByUser(user uuid.UUID) bool
- func (r *SessionRepository) FindById(id uuid.UUID) (*Session, bool)
- func (r *SessionRepository) FindByUserId(userId uuid.UUID) (*Session, bool)
- func (r *SessionRepository) Iter(routine func(*Session))
- func (r *SessionRepository) Len() int
- func (r *SessionRepository) LenUserSession() int
- func (r *SessionRepository) New(s *Session) bool
- func (r *SessionRepository) Update(s *Session) bool
- type SessionType
- type SignalChannelKind
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrSessionAlreadyClosed = errors.New("session already closed") ErrIngressAlreadyExists = errors.New("ingress resource already exists in session") ErrEgressAlreadyExists = errors.New("egress resource already exists in session") ErrNoSignalChannel = errors.New("no signal channel connection exists in session") ErrSessionProcessWaitingTimeout = errors.New("session process waiting timeout") )
Functions ¶
This section is empty.
Types ¶
type RtpEngine ¶
type RtpEngine interface { EstablishEndpoint(ctx context.Context, sessionCtx context.Context, sessionId uuid.UUID, liveStream uuid.UUID, offer webrtc.SessionDescription, endpointType rtp.EndpointType, options ...rtp.EndpointOption) (*rtp.Endpoint, error) OfferEndpoint(ctx context.Context, sessionCtx context.Context, sessionId uuid.UUID, liveStream uuid.UUID, endpointType rtp.EndpointType, options ...rtp.EndpointOption) (*rtp.Endpoint, error) }
type Session ¶
func NewSession ¶
func (*Session) CreateEgressEndpoint ¶
func (s *Session) CreateEgressEndpoint(ctx context.Context, offer *webrtc.SessionDescription, signalKind SignalChannelKind) (*webrtc.SessionDescription, error)
CreateEgressEndpoint Receives an Offer and generates an Answer to establish an Egress WebRTC connection.
func (*Session) CreateIngressEndpoint ¶
func (s *Session) CreateIngressEndpoint(ctx context.Context, offer *webrtc.SessionDescription, signalKind SignalChannelKind) (*webrtc.SessionDescription, error)
CreateIngressEndpoint Receives an Offer and generates an Answer to establish an Ingress WebRTC connection.
func (*Session) OfferEgressEndpoint ¶
func (s *Session) OfferEgressEndpoint(ctx context.Context, signalKind SignalChannelKind) (*webrtc.SessionDescription, error)
OfferEgressEndpoint Creates an offer and prepares an Egress WebRTC connection. The connection then waits for the response from the other peer.
func (*Session) OfferIngressEndpoint ¶
func (s *Session) OfferIngressEndpoint(ctx context.Context, signalKind SignalChannelKind) (*webrtc.SessionDescription, error)
OfferIngressEndpoint Creates an offer and prepares an Ingress WebRTC connection. The connection then waits for the response from the other peer.
func (*Session) SetEgressAnswer ¶
func (s *Session) SetEgressAnswer(answer *webrtc.SessionDescription) chan struct{}
func (*Session) SetIngressAnswer ¶
func (s *Session) SetIngressAnswer(answer *webrtc.SessionDescription) chan struct{}
type SessionRepository ¶
type SessionRepository struct {
// contains filtered or unexported fields
}
func NewSessionRepository ¶
func NewSessionRepository() *SessionRepository
func (*SessionRepository) Add ¶
func (r *SessionRepository) Add(s *Session)
func (*SessionRepository) DeleteByUser ¶
func (r *SessionRepository) DeleteByUser(user uuid.UUID) bool
func (*SessionRepository) FindById ¶
func (r *SessionRepository) FindById(id uuid.UUID) (*Session, bool)
func (*SessionRepository) FindByUserId ¶
func (r *SessionRepository) FindByUserId(userId uuid.UUID) (*Session, bool)
func (*SessionRepository) Iter ¶
func (r *SessionRepository) Iter(routine func(*Session))
func (*SessionRepository) Len ¶
func (r *SessionRepository) Len() int
func (*SessionRepository) LenUserSession ¶
func (r *SessionRepository) LenUserSession() int
func (*SessionRepository) New ¶
func (r *SessionRepository) New(s *Session) bool
func (*SessionRepository) Update ¶
func (r *SessionRepository) Update(s *Session) bool
type SessionType ¶
type SessionType int
const ( // UserSession represents the connection of a user directly connected to this instance UserSession SessionType = iota + 1 // InstanceSession represents the connection to the Shig instance hosting the live stream. // When the livestream belongs to another Shig instance, this Shig instance connects to that remote instance. InstanceSession // RemoteInstanceSession represents the connection of another Shig instance. RemoteInstanceSession )
type SignalChannelKind ¶
type SignalChannelKind int
const ( SilentSignalChannel SignalChannelKind = iota + 1 UnidirectionalSignalChannel BidirectionalSignalChannel )
Click to show internal directories.
Click to hide internal directories.