sstv

package
v0.0.0-...-5b3075f Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2020 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ServeChanList

func ServeChanList(runtime RuntimeUtils) func(http.ResponseWriter, *http.Request)

ServeChanList Serve the combined m3u playlist

func ServeChanRedir

func ServeChanRedir(runtime RuntimeUtils) func(http.ResponseWriter, *http.Request)

ServeChanRedir Redirect to authenticated m3u8 stream

func ServeEPG

func ServeEPG(runtime RuntimeUtils) func(http.ResponseWriter, *http.Request)

ServeEPG Serve the combined EPG

func ServeRuvRedir

func ServeRuvRedir(runtime RuntimeUtils) func(http.ResponseWriter, *http.Request)

ServeRuvRedir Redirect to geoblocked ruv m3u8 stream

Types

type AuthResponse

type AuthResponse struct {
	Hash  string
	Valid int64
	Code  string
	Error string
}

AuthResponse Authentication json response

type CacheClient

type CacheClient interface {
	Get(key string) (string, error)
	Set(key string, value string, expiration time.Duration) error
}

CacheClient Interface for cacheclient

type Channel

type Channel struct {
	Text        string   `xml:",chardata"`
	ID          string   `xml:"id,attr"`
	DisplayName TextLang `xml:"display-name"`
	URL         string   `xml:"url,omitempty"`
}

Channel XML channel

type Config

type Config struct {
	RedisURL         string `envconfig:"REDIS_URL" default:"localhost:6379"`
	EpgBase          string `envconfig:"EPG_BASE"`
	JSONTVUrl        string `envconfig:"JSONTVURL" default:"https://fast-guide.smoothstreams.tv/"`
	Username         string `envconfig:"USERNAME"`
	Password         string `envconfig:"PASSWORD"`
	BaseURL          string `envconfig:"BASE_URL"`
	RuvAPIURL        string `envconfig:"RUV_API_URL" default:"http://ruv.is/sites/all/themes/at_ruv/scripts/ruv-stream.php?format=json"`
	RuvUseGeoblocked bool   `envconfig:"RUV_USE_GEO"`
	Port             string `envconfig:"PORT" default:"80"`
}

Config All configuration that sstv logic should need

func GetConfig

func GetConfig() Config

GetConfig get global SSTV configuration

type EPG

type EPG struct {
	XMLName           xml.Name    `xml:"tv"`
	Text              string      `xml:",chardata"`
	GeneratorInfoName string      `xml:"generator-info-name,attr"`
	GeneratorInfoURL  string      `xml:"generator-info-url,attr"`
	Channel           []Channel   `xml:"channel"`
	Programme         []Programme `xml:"programme"`
}

EPG Top-level xml epg

type FakeCache

type FakeCache struct {
	GetFunc func(string) (string, error)
	SetFunc func(string, string, time.Duration) error
}

FakeCache to be used for testing

func (*FakeCache) Get

func (r *FakeCache) Get(key string) (string, error)

Get Getter overloaded by GetFunc

func (*FakeCache) Set

func (r *FakeCache) Set(key string, value string, exp time.Duration) error

Set Setter overloaded by SetFunc

type JSONEvent

type JSONEvent struct {
	Name        string
	Description string
	Time        string
	Runtime     string
	Category    string
}

JSONEvent JSON event in sstv epg

type Programme

type Programme struct {
	Text     string    `xml:",chardata"`
	Start    string    `xml:"start,attr"`
	Stop     string    `xml:"stop,attr"`
	Channel  string    `xml:"channel,attr"`
	Title    TextLang  `xml:"title"`
	SubTitle *TextLang `xml:"sub-title,omitempty"`
	Desc     *TextLang `xml:"desc,omitempty"`
}

Programme XML programme

type RuntimeUtils

type RuntimeUtils struct {
	Cache CacheClient
}

RuntimeUtils should contain everything external

type RuvChannelResponse

type RuvChannelResponse struct {
	Result []string
}

RuvChannelResponse Channel response for geoblocked RUV

type SSEpg

type SSEpg struct {
	Channels []SSEpgChannel
}

SSEpg Intermediary type for conversion from sstv EPG to EPG

type SSEpgChannel

type SSEpgChannel struct {
	Number string
	Name   string
	Img    string
	Events []SSEpgEvent
}

SSEpgChannel A channel for SSEpg

type SSEpgEvent

type SSEpgEvent struct {
	Name        string
	Description string
	Category    string
	Start       time.Time
	Stop        time.Time
}

SSEpgEvent An event for SSEpgChannel

type TextLang

type TextLang struct {
	Text string `xml:",chardata"`
	Lang string `xml:"lang,attr,omitempty"`
}

TextLang XML with optional language

Jump to

Keyboard shortcuts

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