Documentation
¶
Index ¶
- Variables
- type NSManager
- func (m *NSManager) GetOrNewNamespace(ctx context.Context, name string) (*Namespace, bool)
- func (m *NSManager) GetOrNewNamespaceByDomain(ctx context.Context, domain string) (*Namespace, bool)
- func (m *NSManager) LookupDomain(domain string) (*Namespace, bool)
- func (m *NSManager) Namespaces() []*Namespace
- func (m *NSManager) String() string
- type NSManagerParams
- type Namespace
- type NamespaceParams
- type PeerParams
- type Router
- type RouterImpl
- type RouterParams
- type Session
- type Stream
- type StreamFormat
- type StreamFormatImpl
- type StreamFormatOption
- type StreamImpl
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNSNotFound = errors.New("namespace not found") ErrRouterNotFound = errors.New("router not found") ErrSessionAlreadyExists = errors.New("session already exists") ErrRouterClosed = errors.New("router closed") ErrSessionIdleTimeout = errors.New("session idle timeout") ErrProducerEmpty = errors.New("producer empty") ErrProducerRepeated = errors.New("producer repeated") ErrStreamFormatNotFound = errors.New("stream format not found") ErrStreamClosed = errors.New("stream closed") ErrNilFrameDestination = errors.New("nil frame destination") ErrNilFrameSource = errors.New("nil frame source") ErrStreamTimeout = errors.New("stream timeout") ErrFrameSourceExists = errors.New("frame source exists") ErrPaddingDestination = errors.New("padding destination") )
Functions ¶
This section is empty.
Types ¶
type NSManager ¶
type NSManager struct {
// contains filtered or unexported fields
}
func NewNSManager ¶
func NewNSManager(params NSManagerParams) *NSManager
func (*NSManager) GetOrNewNamespace ¶
func (*NSManager) GetOrNewNamespaceByDomain ¶
func (*NSManager) Namespaces ¶
type NSManagerParams ¶
type NSManagerParams struct { Namespaces map[string]NamespaceParams `yaml:"namespaces" json:"namespaces" mapstructure:"namespaces"` DefaultNamespaceParams *NamespaceParams `yaml:"default_namespace" json:"default_namespace" mapstructure:"default_namespace"` }
type Namespace ¶
type Namespace struct {
// contains filtered or unexported fields
}
func NewNamespace ¶
func NewNamespace(ctx context.Context, params NamespaceParams) *Namespace
func (*Namespace) RemoveRouter ¶
type NamespaceParams ¶
type NamespaceParams struct { Name string `yaml:"name" json:"name" mapstructure:"name"` Domains []string `yaml:"domains" json:"domains" mapstructure:"domains"` DefaultRouterParams RouterParams `yaml:"default_router" json:"default_router" mapstructure:"default_router"` RoutersParams map[string]RouterParams `yaml:"routers" json:"routers" mapstructure:"routers"` }
type PeerParams ¶
type PeerParams struct { ACodec deliver.CodecType `json:"audio_codec"` VCodec deliver.CodecType `json:"video_codec"` PacketType deliver.PacketType `json:"packet_type"` RemoteAddr string LocalAddr string PeerID string RouterID string Domain string URI string // URI is the path of the request, e.g. /live/room1 Args map[string]string Producer bool HasAudio bool HasVideo bool HasDataChannel bool }
type Router ¶
type RouterImpl ¶
type RouterImpl struct {
// contains filtered or unexported fields
}
func (*RouterImpl) AddSession ¶
func (r *RouterImpl) AddSession(s Session) error
func (*RouterImpl) Closed ¶
func (r *RouterImpl) Closed() bool
func (*RouterImpl) Context ¶
func (r *RouterImpl) Context() context.Context
func (*RouterImpl) ID ¶
func (r *RouterImpl) ID() string
func (*RouterImpl) Namespace ¶
func (r *RouterImpl) Namespace() *Namespace
type RouterParams ¶
type RouterParams struct { IdleSubscriberTimeout int `yaml:"idle_subscriber_timeout" json:"idle_subscriber_timeout" mapstructure:"idle_subscriber_timeout"` MaxProducerTimeout int `yaml:"max_producer_timeout" json:"max_producer_timeout" mapstructure:"max_producer_timeout"` MaxSubscriberTimeout int `yaml:"max_subscriber_timeout" json:"max_subscriber_timeout" mapstructure:"max_subscriber_timeout"` }
type Session ¶
type Session interface { ID() string Set(key, value interface{}) Get(key interface{}) interface{} Logger() *logrus.Entry Context() context.Context GetNamespace() *Namespace SetNamespace(ns *Namespace) GetRouter() Router SetRouter(r Router) PeerParams() PeerParams Finalize(e error) RouterID() string BindFrameSource(src deliver.FrameSource) error BindFrameDestination(dest deliver.FrameDestination) error FrameSource() deliver.FrameSource FrameDestination() deliver.FrameDestination Join() error }
type Stream ¶
type Stream interface { GetFormat(fmtName string) (StreamFormat, error) AddFrameSource(source deliver.FrameSource) error AddFrameDestination(dest deliver.FrameDestination) (err error) Close() }
type StreamFormat ¶
type StreamFormat interface { deliver.MediaFramePipe }
func NewStreamFormat ¶
func NewStreamFormat(ctx context.Context, fmtSettings deliver.FormatSettings, opts ...StreamFormatOption) (StreamFormat, error)
type StreamFormatImpl ¶
type StreamFormatImpl struct { deliver.MediaFramePipe // contains filtered or unexported fields }
func (*StreamFormatImpl) Close ¶
func (fmt *StreamFormatImpl) Close()
type StreamFormatOption ¶
type StreamFormatOption func(*StreamFormatImpl)
func WithFrameSourceManager ¶
func WithFrameSourceManager(sm *sourcemanager.Instance) StreamFormatOption
type StreamImpl ¶
type StreamImpl struct {
// contains filtered or unexported fields
}
func (*StreamImpl) AddFrameDestination ¶
func (s *StreamImpl) AddFrameDestination(dest deliver.FrameDestination) (err error)
func (*StreamImpl) AddFrameSource ¶
func (s *StreamImpl) AddFrameSource(source deliver.FrameSource) error
func (*StreamImpl) Close ¶
func (s *StreamImpl) Close()
func (*StreamImpl) GetFormat ¶
func (s *StreamImpl) GetFormat(fmtName string) (StreamFormat, error)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.