Documentation ¶
Index ¶
- Constants
- Variables
- func NewBufferedResponseWrtier(w http.ResponseWriter) *bufferedResponseWriter
- func RegisterCommonFlags(c *cli.App)
- func RegisterContentProberFlags(c *cli.App)
- func RegisterS3SessionFlags(c *cli.App)
- func RegisterS3StorageFlags(c *cli.App)
- func RegisterServerWithErrorFlags(c *cli.App)
- func RegisterSnapshotFlags(c *cli.App)
- func RegisterWebExpireFlags(c *cli.App)
- func RegisterWebFlags(c *cli.App)
- type AccessLock
- type ContentProbe
- type Counter
- type DownloadedSizeFetcher
- type DownloadedSizePool
- type DownloadedSizePusher
- type HLS
- type HLSParser
- type HLSStream
- func (h *HLSStream) GetCodecParams() []string
- func (h *HLSStream) GetFFmpegParams() []string
- func (h *HLSStream) GetLanguage() string
- func (h *HLSStream) GetName() string
- func (h *HLSStream) GetPlaylistName() string
- func (h *HLSStream) GetPlaylistPath() string
- func (h *HLSStream) GetSegmentExtension() string
- func (h *HLSStream) GetSegmentFormat() string
- func (h *HLSStream) MakeMasterPlaylist() string
- type Handleable
- type Key
- type OriginalSizeFetcher
- type Rendition
- type S3Client
- type S3Session
- type S3Storage
- func (s *S3Storage) CheckDoneMarker(ctx context.Context, key string) (bool, error)
- func (s *S3Storage) FetchDownloadedSize(ctx context.Context, key string) (uint64, error)
- func (s *S3Storage) SetDoneMarker(ctx context.Context, key string) (err error)
- func (s *S3Storage) StoreDownloadedSize(ctx context.Context, key string, i uint64) (err error)
- func (s *S3Storage) Touch(ctx context.Context, key string) (err error)
- func (s *S3Storage) Upload(ctx context.Context, key string, out string) error
- type ServeWithStatus
- type Snapshotter
- type StreamMode
- type StreamType
- type TouchPool
- type Toucher
- type Transcoder
- type Waiter
- type Web
- type WebExpire
Constants ¶
View Source
const ( OutputFlag = "output" UseSnapshotFlag = "use-snapshot" StreamModeFlag = "stream-mode" KeyPrefixFlag = "key-prefix" ToCompletionFlag = "to-completion" )
View Source
const (
WebGraceFlag = "grace"
)
Variables ¶
View Source
var DefaultRenditions = []Rendition{ { Height: 240, DefRate: 500, Required: true, }, { Height: 360, DefRate: 1000, Required: true, }, { Height: 480, DefRate: 2500, }, { Height: 720, DefRate: 5000, }, { Height: 1080, DefRate: 8000, }, }
https://support.google.com/youtube/answer/1722171?hl=en#zippy=%2Cbitrate
Functions ¶
func NewBufferedResponseWrtier ¶
func NewBufferedResponseWrtier(w http.ResponseWriter) *bufferedResponseWriter
func RegisterCommonFlags ¶
func RegisterS3SessionFlags ¶
func RegisterS3StorageFlags ¶
func RegisterSnapshotFlags ¶
func RegisterWebExpireFlags ¶
func RegisterWebFlags ¶
Types ¶
type AccessLock ¶
type AccessLock struct { C chan error // contains filtered or unexported fields }
func NewAccessLock ¶
func NewAccessLock() *AccessLock
func (*AccessLock) Unlock ¶
func (al *AccessLock) Unlock()
func (*AccessLock) Unlocked ¶
func (al *AccessLock) Unlocked() chan error
type ContentProbe ¶
type ContentProbe struct {
// contains filtered or unexported fields
}
func NewContentProbe ¶
func NewContentProbe(c *cli.Context) *ContentProbe
func (*ContentProbe) Get ¶
func (s *ContentProbe) Get() (*cp.ProbeReply, error)
type Counter ¶
type Counter struct {
// contains filtered or unexported fields
}
func NewCounter ¶
func NewCounter() *Counter
func (*Counter) NewResponseWriter ¶
func (s *Counter) NewResponseWriter(w http.ResponseWriter) *responseWriterCounter
type DownloadedSizeFetcher ¶
type DownloadedSizeFetcher struct {
// contains filtered or unexported fields
}
func NewDownloadedSizeFetcher ¶
func NewDownloadedSizeFetcher(ctx context.Context, st *S3Storage, key *Key) *DownloadedSizeFetcher
func (*DownloadedSizeFetcher) Fetch ¶
func (s *DownloadedSizeFetcher) Fetch() (uint64, error)
type DownloadedSizePool ¶
type DownloadedSizePool struct {
// contains filtered or unexported fields
}
func NewDownloadSizePool ¶
func NewDownloadSizePool(st *S3Storage, counter *Counter, key *Key, isf *DownloadedSizeFetcher) *DownloadedSizePool
func (*DownloadedSizePool) Handle ¶
func (s *DownloadedSizePool) Handle(h Handleable)
func (*DownloadedSizePool) Push ¶
func (s *DownloadedSizePool) Push(size uint64) error
type DownloadedSizePusher ¶
type DownloadedSizePusher struct {
// contains filtered or unexported fields
}
func NewDownloadedSizePusher ¶
func (*DownloadedSizePusher) Push ¶
func (s *DownloadedSizePusher) Push() error
type HLS ¶
type HLS struct {
// contains filtered or unexported fields
}
func NewHLS ¶
func NewHLS(in string, out string, probe *cp.ProbeReply, sm StreamMode) *HLS
func (*HLS) GetFFmpegParams ¶
func (*HLS) MakeMasterPlaylist ¶
type HLSParser ¶
type HLSParser struct {
// contains filtered or unexported fields
}
func NewHLSParser ¶
func NewHLSParser(c *cli.Context, pr *ContentProbe) *HLSParser
type HLSStream ¶
type HLSStream struct {
// contains filtered or unexported fields
}
func NewHLSStream ¶
func (*HLSStream) GetCodecParams ¶
func (*HLSStream) GetFFmpegParams ¶
func (*HLSStream) GetLanguage ¶
func (*HLSStream) GetPlaylistName ¶
func (*HLSStream) GetPlaylistPath ¶
func (*HLSStream) GetSegmentExtension ¶
func (*HLSStream) GetSegmentFormat ¶
func (*HLSStream) MakeMasterPlaylist ¶
type OriginalSizeFetcher ¶
type OriginalSizeFetcher struct {
// contains filtered or unexported fields
}
func NewOriginalSizeFetcher ¶
func NewOriginalSizeFetcher(c *cli.Context, cl *http.Client) *OriginalSizeFetcher
func (*OriginalSizeFetcher) Fetch ¶
func (s *OriginalSizeFetcher) Fetch() (uint64, error)
type S3Client ¶
type S3Client struct {
// contains filtered or unexported fields
}
func NewS3Client ¶
type S3Session ¶
type S3Session struct {
// contains filtered or unexported fields
}
S3Client makes AWS SDK S3 Client from cli and environment variables
type S3Storage ¶
type S3Storage struct {
// contains filtered or unexported fields
}
func (*S3Storage) CheckDoneMarker ¶
func (*S3Storage) FetchDownloadedSize ¶
func (*S3Storage) SetDoneMarker ¶
func (*S3Storage) StoreDownloadedSize ¶
type ServeWithStatus ¶
type ServeWithStatus struct {
// contains filtered or unexported fields
}
func NewServeWithStatus ¶
func (*ServeWithStatus) Serve ¶
func (s *ServeWithStatus) Serve() (err error)
type Snapshotter ¶
type Snapshotter struct {
// contains filtered or unexported fields
}
func NewSpapshotter ¶
func NewSpapshotter(c *cli.Context, co *Counter, st *S3Storage, key *Key, transcoder *Transcoder, osf *OriginalSizeFetcher, dsf *DownloadedSizeFetcher) *Snapshotter
func (*Snapshotter) Close ¶
func (s *Snapshotter) Close()
func (*Snapshotter) Serve ¶
func (s *Snapshotter) Serve() error
type StreamType ¶
type StreamType string
const ( Audio StreamType = "a" Video StreamType = "v" Subtitle StreamType = "s" )
type TouchPool ¶
type TouchPool struct {
// contains filtered or unexported fields
}
func NewTouchPool ¶
func (*TouchPool) Handle ¶
func (s *TouchPool) Handle(h Handleable)
type Transcoder ¶
type Transcoder struct {
// contains filtered or unexported fields
}
func NewTranscoder ¶
func NewTranscoder(c *cli.Context, h *HLSParser) *Transcoder
func (*Transcoder) Close ¶
func (s *Transcoder) Close() error
func (*Transcoder) Serve ¶
func (s *Transcoder) Serve() (err error)
type Waiter ¶
type Waiter struct {
// contains filtered or unexported fields
}
func (*Waiter) Handle ¶
func (s *Waiter) Handle(h Handleable)
type WebExpire ¶
type WebExpire struct {
// contains filtered or unexported fields
}
func NewWebExpire ¶
func (*WebExpire) Handle ¶
func (s *WebExpire) Handle(h Handleable)
func (*WebExpire) NewResponseWriter ¶
func (s *WebExpire) NewResponseWriter(w http.ResponseWriter) *expireResponseWriter
Source Files ¶
- access_lock.go
- allow_cors_handler.go
- buffered_response_writer.go
- common.go
- content_prober.go
- counter.go
- downloaded_size_fetcher.go
- downloaded_size_pool.go
- downloaded_size_pusher.go
- enrich_playlist_handler.go
- hls_parser.go
- key.go
- original_size_fetcher.go
- s3_client.go
- s3_session.go
- s3_storage.go
- serve_with_status.go
- snapshotter.go
- touch_pool.go
- toucher.go
- transcoder.go
- waiter.go
- web.go
- web_expire.go
Click to show internal directories.
Click to hide internal directories.