Documentation ¶
Index ¶
- Constants
- func SetLogHandler(handler slog.Handler)
- type Announcement
- type AnnouncementHandler
- type AnnouncementHandlerFunc
- type AnnouncementResponseWriter
- type ApplicationError
- type Connection
- type LocalTrack
- type Location
- type LocationMode
- type Object
- type ObjectForwardingPreference
- type ObjectWriter
- type ProtocolError
- type ReceiveStream
- type RemoteTrack
- type Role
- type SendStream
- type Session
- func (s *Session) AddLocalTrack(t *LocalTrack) error
- func (s *Session) Announce(ctx context.Context, namespace string) error
- func (s *Session) Close() error
- func (s *Session) CloseWithError(code uint64, msg string) error
- func (s *Session) RunClient() error
- func (s *Session) RunServer(ctx context.Context) error
- func (s *Session) Subscribe(ctx context.Context, subscribeID, trackAlias uint64, ...) (*RemoteTrack, error)
- type Stream
- type Subscription
- type SubscriptionHandler
- type SubscriptionHandlerFunc
- type SubscriptionResponseWriter
Constants ¶
View Source
const ( ErrorCodeNoError = 0x00 ErrorCodeInternal = 0x01 ErrorCodeProtocolViolation = 0x03 ErrorCodeDuplicateTrackAlias = 0x04 ErrorCodeParameterLengthMismatch = 0x05 ErrorCodeGoAwayTimeout = 0x10 // Errors not included in current draft ErrorCodeUnsupportedVersion = 0xff01 ErrorCodeTrackNotFound = 0xff02 )
View Source
const ( SubscribeErrorInternal = 0x00 SubscribeErrorInvalidRange = 0x01 SubscribeErrorRetryTrackAlias = 0x02 // TODO: These are not specified yet, but seem useful SubscribeErrorUnknownTrack = 0x03 )
View Source
const ( SubscribeStatusUnsubscribed = 0x00 SubscribeStatusInternalError = 0x01 SubscribeStatusTrackEnded = 0x03 SubscribeStatusSubscriptionEnded = 0x04 SubscribeStatusGoingAway = 0x05 SubscribeStatusExpired = 0x06 )
View Source
const ( DRAFT_IETF_MOQ_TRANSPORT_00 = 0xff000000 DRAFT_IETF_MOQ_TRANSPORT_01 = 0xff000001 DRAFT_IETF_MOQ_TRANSPORT_02 = 0xff000002 DRAFT_IETF_MOQ_TRANSPORT_03 = 0xff000003 CURRENT_VERSION = DRAFT_IETF_MOQ_TRANSPORT_03 )
Variables ¶
This section is empty.
Functions ¶
func SetLogHandler ¶ added in v0.2.0
Types ¶
type Announcement ¶ added in v0.2.0
type Announcement struct {
// contains filtered or unexported fields
}
func (*Announcement) Namespace ¶ added in v0.2.0
func (a *Announcement) Namespace() string
type AnnouncementHandler ¶
type AnnouncementHandler interface {
HandleAnnouncement(*Session, *Announcement, AnnouncementResponseWriter)
}
type AnnouncementHandlerFunc ¶ added in v0.3.0
type AnnouncementHandlerFunc func(*Session, *Announcement, AnnouncementResponseWriter)
func (AnnouncementHandlerFunc) HandleAnnouncement ¶ added in v0.3.0
func (f AnnouncementHandlerFunc) HandleAnnouncement(s *Session, a *Announcement, arw AnnouncementResponseWriter)
type AnnouncementResponseWriter ¶ added in v0.3.0
type ApplicationError ¶ added in v0.3.0
type ApplicationError struct {
// contains filtered or unexported fields
}
func (ApplicationError) Error ¶ added in v0.3.0
func (e ApplicationError) Error() string
type Connection ¶ added in v0.3.0
type Connection interface { OpenStream() (Stream, error) OpenStreamSync(context.Context) (Stream, error) OpenUniStream() (SendStream, error) OpenUniStreamSync(context.Context) (SendStream, error) AcceptStream(context.Context) (Stream, error) AcceptUniStream(context.Context) (ReceiveStream, error) SendDatagram([]byte) error ReceiveDatagram(context.Context) ([]byte, error) CloseWithError(uint64, string) error }
type LocalTrack ¶ added in v0.3.0
type LocalTrack struct { ID uint64 Namespace string Name string // contains filtered or unexported fields }
A LocalTrack is a local media source. Writing objects to the track will relay the objects to all subscribers. All methods are safe for concurrent use. Ordering of objects is only guaranteed within MultiObjectStreams. LocalTracks must be created with NewLocalTrack to ensure proper initialization.
func NewLocalTrack ¶ added in v0.3.0
func NewLocalTrack(id uint64, namespace, trackname string) *LocalTrack
NewLocalTrack creates a new LocalTrack
func (*LocalTrack) Close ¶ added in v0.3.0
func (t *LocalTrack) Close() error
func (*LocalTrack) SubscriberCount ¶ added in v0.3.0
func (t *LocalTrack) SubscriberCount() int
func (*LocalTrack) WriteObject ¶ added in v0.3.0
func (t *LocalTrack) WriteObject(ctx context.Context, o Object) error
WriteObject adds an object to the track
type Location ¶ added in v0.2.0
type Location struct { Mode LocationMode Value uint64 }
type LocationMode ¶ added in v0.2.0
type LocationMode int
const ( LocationModeNone LocationMode = iota LocationModeAbsolute LocationModeRelativePrevious LocationModeRelativeNext )
type Object ¶ added in v0.3.0
type Object struct { GroupID uint64 ObjectID uint64 ObjectSendOrder uint64 ForwardingPreference ObjectForwardingPreference Payload []byte }
type ObjectForwardingPreference ¶ added in v0.3.0
type ObjectForwardingPreference int
const ( ObjectForwardingPreferenceDatagram ObjectForwardingPreference = iota ObjectForwardingPreferenceStream ObjectForwardingPreferenceStreamGroup ObjectForwardingPreferenceStreamTrack )
type ObjectWriter ¶ added in v0.3.0
An ObjectWriter allows sending objects using.
type ProtocolError ¶ added in v0.3.0
type ProtocolError struct {
// contains filtered or unexported fields
}
func (ProtocolError) Code ¶ added in v0.3.0
func (e ProtocolError) Code() uint64
func (ProtocolError) Error ¶ added in v0.3.0
func (e ProtocolError) Error() string
type ReceiveStream ¶ added in v0.3.0
type RemoteTrack ¶ added in v0.3.0
type RemoteTrack struct {
// contains filtered or unexported fields
}
func (*RemoteTrack) ReadObject ¶ added in v0.3.0
func (s *RemoteTrack) ReadObject(ctx context.Context) (Object, error)
func (*RemoteTrack) Unsubscribe ¶ added in v0.3.0
func (s *RemoteTrack) Unsubscribe()
type SendStream ¶ added in v0.3.0
type SendStream interface { io.WriteCloser }
type Session ¶ added in v0.2.0
type Session struct { Conn Connection EnableDatagrams bool LocalRole Role RemoteRole Role AnnouncementHandler AnnouncementHandler SubscriptionHandler SubscriptionHandler // contains filtered or unexported fields }
func (*Session) AddLocalTrack ¶ added in v0.3.0
func (s *Session) AddLocalTrack(t *LocalTrack) error
func (*Session) CloseWithError ¶ added in v0.2.0
type Stream ¶ added in v0.3.0
type Stream interface { ReceiveStream SendStream }
type Subscription ¶ added in v0.3.0
type SubscriptionHandler ¶
type SubscriptionHandler interface {
HandleSubscription(*Session, *Subscription, SubscriptionResponseWriter)
}
type SubscriptionHandlerFunc ¶ added in v0.3.0
type SubscriptionHandlerFunc func(*Session, *Subscription, SubscriptionResponseWriter)
func (SubscriptionHandlerFunc) HandleSubscription ¶ added in v0.3.0
func (f SubscriptionHandlerFunc) HandleSubscription(se *Session, su *Subscription, srw SubscriptionResponseWriter)
type SubscriptionResponseWriter ¶ added in v0.3.0
type SubscriptionResponseWriter interface { Accept(*LocalTrack) Reject(code uint64, reason string) }
Source Files ¶
- announcement.go
- connection.go
- control_stream.go
- errors.go
- group_header_stream.go
- local_track.go
- location.go
- logging.go
- message.go
- object_stream.go
- parameter.go
- parameter_string.go
- parameter_varint.go
- remote_track.go
- role.go
- send_subscription.go
- session.go
- subscription.go
- sync_map.go
- track_header_stream.go
- transport.go
- varintstring.go
- version.go
Click to show internal directories.
Click to hide internal directories.