Documentation ¶
Index ¶
- func ResolveTemplate(format string, params TemplateParams) string
- type Config
- type DASHConfig
- type DASHInspector
- type DASHSegment
- type File
- type FilterResult
- type HLSConfig
- type HLSInspector
- type HLSSegment
- type Manifest
- type MasterPlaylist
- type MediaPlaylist
- type Meta
- type Monitor
- type OnDownloadHandler
- type OnReportHandler
- type OnTerminateHandler
- type Playlists
- type Report
- type Reports
- type SegmentFilter
- func AllSegmentRejectionFilter() SegmentFilter
- func HashSamplingSegmentFilter(rate float64) SegmentFilter
- func MaxBandwidthSegmentFilter(bandwidth int64) SegmentFilter
- func MinBandwidthSegmentFilter(bandwidth int64) SegmentFilter
- func SegmentFilterAnd(filters ...SegmentFilter) SegmentFilter
- func SegmentFilterOr(filters ...SegmentFilter) SegmentFilter
- type SegmentStore
- type Severity
- func (s Severity) BetterThan(o Severity) bool
- func (s Severity) BetterThanOrEqual(o Severity) bool
- func (s Severity) MarshalText() ([]byte, error)
- func (s Severity) String() string
- func (s *Severity) UnmarshalText(text []byte) error
- func (s Severity) WorseThan(o Severity) bool
- func (s Severity) WorseThanOrEqual(o Severity) bool
- type StreamType
- type TemplateParams
- type Values
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ResolveTemplate ¶
func ResolveTemplate(format string, params TemplateParams) string
Types ¶
type Config ¶
type Config struct { URL string DefaultInterval time.Duration PrioritizeSuggestedInterval bool HTTPClient *http.Client RequestHeader http.Header NoRedirectCache bool ManifestTimeout time.Duration ManifestBackoff backoff.BackOff SegmentTimeout time.Duration SegmentBackoff backoff.BackOff SegmentMaxConcurrency int SegmentFilter SegmentFilter StreamType StreamType TerminateIfVOD bool HLS *HLSConfig DASH *DASHConfig // OnDownload will be called when HTTP GET method succeeds. // This function must be thread-safe. OnDownload OnDownloadHandler OnReport OnReportHandler OnTerminate OnTerminateHandler }
func NewConfig ¶
func NewConfig(url string, streamType StreamType) *Config
type DASHConfig ¶
type DASHConfig struct {
Inspectors []DASHInspector
}
type DASHInspector ¶
type DASHInspector interface {
Inspect(manifest *Manifest, segments SegmentStore) *Report
}
type DASHSegment ¶
type DASHSegment struct { URL string Initialization bool Time uint64 Duration uint64 Period *mpd.Period AdaptationSet *mpd.AdaptationSet SegmentTemplate *mpd.SegmentTemplate Representation *mpd.Representation }
type HLSConfig ¶
type HLSConfig struct {
Inspectors []HLSInspector
}
type HLSInspector ¶
type HLSInspector interface {
Inspect(playlists *Playlists, segments SegmentStore) *Report
}
type HLSSegment ¶
type HLSSegment struct { URL string // VariantParams is reference to related VariantParams object in MasterPlaylist. // This property is nullable. VariantParams *m3u8.VariantParams // Alternative is reference to related Alternative object in MasterPlaylist. // This property is nullable. Alternative *m3u8.Alternative }
type Manifest ¶
func (*Manifest) EachSegments ¶
func (m *Manifest) EachSegments(handle func(*DASHSegment) (cont bool)) error
func (*Manifest) Segments ¶
func (m *Manifest) Segments() ([]*DASHSegment, error)
type MasterPlaylist ¶
type MediaPlaylist ¶
type MediaPlaylist struct { URL string Raw []byte Time time.Time *m3u8.MediaPlaylist VariantParams *m3u8.VariantParams Alternative *m3u8.Alternative }
func (*MediaPlaylist) SegmentURLs ¶
func (p *MediaPlaylist) SegmentURLs() ([]string, error)
type Meta ¶
type Meta struct { URL string `json:"url"` Via string `json:"via"` RequestHeader http.Header `json:"requestHeader"` ResponseHeader http.Header `json:"responseHeader"` Status string `json:"status"` // e.g. "200 OK" StatusCode int `json:"statusCode"` // e.g. 200 Proto string `json:"proto"` // e.g. "HTTP/1.0" ProtoMajor int `json:"protoMajor"` // e.g. 1 ProtoMinor int `json:"protoMinor"` // e.g. 0 ContentLength int64 `json:"contentLength"` TransferEncoding []string `json:"transferEncoding"` Uncompressed bool `json:"uncompressed"` RequestTimestamp time.Time `json:"requestTimestamp"` DownloadTime time.Duration `json:"downloadTime"` }
type OnDownloadHandler ¶
type OnDownloadHandler func(file *File)
func MergeOnDownloadHandlers ¶
func MergeOnDownloadHandlers(handlers ...OnDownloadHandler) OnDownloadHandler
type OnReportHandler ¶
type OnReportHandler func(reports Reports)
func MergeOnReportHandlers ¶
func MergeOnReportHandlers(handlers ...OnReportHandler) OnReportHandler
type OnTerminateHandler ¶
type OnTerminateHandler func()
type Playlists ¶
type Playlists struct { MasterPlaylist *MasterPlaylist MediaPlaylists map[string]*MediaPlaylist }
func (*Playlists) MaxTargetDuration ¶
func (*Playlists) Segments ¶
func (p *Playlists) Segments() ([]*HLSSegment, error)
type SegmentFilter ¶
type SegmentFilter interface { CheckHLS(segment *HLSSegment) FilterResult CheckDASH(segment *DASHSegment) FilterResult }
func AllSegmentRejectionFilter ¶
func AllSegmentRejectionFilter() SegmentFilter
func HashSamplingSegmentFilter ¶
func HashSamplingSegmentFilter(rate float64) SegmentFilter
func MaxBandwidthSegmentFilter ¶
func MaxBandwidthSegmentFilter(bandwidth int64) SegmentFilter
func MinBandwidthSegmentFilter ¶
func MinBandwidthSegmentFilter(bandwidth int64) SegmentFilter
func SegmentFilterAnd ¶
func SegmentFilterAnd(filters ...SegmentFilter) SegmentFilter
func SegmentFilterOr ¶
func SegmentFilterOr(filters ...SegmentFilter) SegmentFilter
type SegmentStore ¶
type Severity ¶
type Severity int
func BestSeverity ¶
func WorstSeverity ¶
func (Severity) BetterThan ¶
func (Severity) BetterThanOrEqual ¶
func (Severity) MarshalText ¶
func (*Severity) UnmarshalText ¶
func (Severity) WorseThanOrEqual ¶
type StreamType ¶
type StreamType int
const ( StreamTypeHLS StreamType = iota StreamTypeDASH )
func (StreamType) String ¶
func (t StreamType) String() string
type TemplateParams ¶
Click to show internal directories.
Click to hide internal directories.