client

package
v0.10.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 7, 2021 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MasterPlaylistName = "master.m3u8"

	Dev = iota
	Prod
)

Variables

View Source
var (
	TranscodedCacheSizeBytes = promauto.NewGauge(prometheus.GaugeOpts{
		Name: "transcoded_cache_size_bytes",
	})
	TranscodedCacheItemsCount = promauto.NewGauge(prometheus.GaugeOpts{
		Name: "transcoded_cache_items_count",
	})
	TranscodedResult = promauto.NewCounterVec(prometheus.CounterOpts{
		Name: "transcoded_request_result",
	}, []string{"type"})

	TranscodedCacheQueryCount = promauto.NewCounter(prometheus.CounterOpts{
		Name: "transcoded_cache_query_count",
	})
	TranscodedCacheMiss = promauto.NewCounter(prometheus.CounterOpts{
		Name: "transcoded_cache_miss",
	})

	FetchSizeBytes = promauto.NewCounterVec(prometheus.CounterOpts{
		Name: "fetch_size_bytes",
	}, []string{"source"})
	FetchDurationSeconds = promauto.NewCounterVec(prometheus.CounterOpts{
		Name: "fetch_duration_seconds",
	}, []string{"source"})
	FetchCount = promauto.NewCounterVec(prometheus.CounterOpts{
		Name: "fetch_count",
	}, []string{"source"})
	FetchFailureCount = promauto.NewCounterVec(prometheus.CounterOpts{
		Name: "fetch_failure_count",
	}, []string{"source", "http_code"})
)
View Source
var ErrNotOK = errors.New("http response not OK")

Functions

This section is empty.

Types

type Client

type Client struct {
	*Configuration
	// contains filtered or unexported fields
}

func New

func New(cfg *Configuration) Client

func (Client) GetPlaybackPath added in v0.9.1

func (c Client) GetPlaybackPath(lurl, sdHash string) string

func (Client) PlayFragment added in v0.9.1

func (c Client) PlayFragment(lurl, sdHash, fragment string, w http.ResponseWriter, r *http.Request) error

PlayFragment ...

func (Client) RestoreCache

func (c Client) RestoreCache() (int64, error)

RestoreCache ...

type Configuration

type Configuration struct {
	// contains filtered or unexported fields
}

func Configure

func Configure() *Configuration

func (*Configuration) CacheSize

func (c *Configuration) CacheSize(size int64) *Configuration

CacheSize defines local disk cache size for downloaded transcoded videos.

func (*Configuration) HTTPClient

func (c *Configuration) HTTPClient(httpClient HTTPRequester) *Configuration

func (*Configuration) ItemsToPrune added in v0.5.9

func (c *Configuration) ItemsToPrune(i uint32) *Configuration

ItemsToPrune defines how many items to prune during cache cleanup

func (*Configuration) LogLevel added in v0.6.1

func (c *Configuration) LogLevel(l int) *Configuration

LogLevel sets verbosity of logging. `Dev` outputs a lot of debugging info, `Prod` is more restrained.

func (*Configuration) Server

func (c *Configuration) Server(server string) *Configuration

Server sets transcoder server API address.

func (*Configuration) VideoPath

func (c *Configuration) VideoPath(videoPath string) *Configuration

Server sets transcoder server API address.

type Fragment added in v0.9.1

type Fragment struct {
	// contains filtered or unexported fields
}

func (Fragment) Path added in v0.9.1

func (f Fragment) Path() string

func (Fragment) Size added in v0.9.1

func (f Fragment) Size() int64

type HTTPRequester

type HTTPRequester interface {
	Do(req *http.Request) (res *http.Response, err error)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL