xmltv

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProgramIDSuffixLength = 4
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Category

type Category struct {
	XMLName  string `xml:"category"`
	Language string `xml:"lang,attr,omitempty"`
	Value    string `xml:",chardata"`
}

type Channel

type Channel struct {
	XMLName      string   `xml:"channel"`
	ID           string   `xml:"id,attr"`
	DisplayNames []string `xml:"display-name"`
	Icon         *Icon    `xml:"icon"`
}

type Description

type Description struct {
	XMLName  string `xml:"desc"`
	Language string `xml:"lang,attr,omitempty"`
	Value    string `xml:",chardata"` // default: Unavailable
}

type EpisodeNumber

type EpisodeNumber struct {
	XMLName string `xml:"episode-num"`
	System  string `xml:"system,attr,omitempty"`
	Value   string `xml:",chardata"`
}

type FinaleShow

type FinaleShow struct {
	XMLName string `xml:"finale"`
}

type Icon

type Icon struct {
	XMLName string `xml:"icon"`
	Source  string `xml:"src,attr,omitempty"`
}

type Length

type Length struct {
	XMLName string `xml:"length"`
	Units   string `xml:"units,attr,omitempty"`
	Value   string `xml:",chardata"`
}

type NewShow

type NewShow struct {
	XMLName string `xml:"new"`
}

type PremiereShow

type PremiereShow struct {
	XMLName string `xml:"premiere"`
}

type PreviouslyShown

type PreviouslyShown struct {
	XMLName string `xml:"previously-shown"`
}

type Program

type Program struct {
	XMLName   string `xml:"programme"`
	StartTime string `xml:"start,attr"`
	EndTime   string `xml:"stop,attr"`
	ChannelID string `xml:"channel,attr"`

	Title           *Title
	Description     *Description
	Subtitle        *Subtitle
	Length          *Length
	Thumbnail       string `xml:"thumbnail,omitempty"`
	Icon            *Icon
	URL             string `xml:"url,omitempty"`
	EpisodeNumbers  []*EpisodeNumber
	Categories      []*Category
	Subtitles       *Subtitles
	Rating          *Rating
	NewShow         *NewShow
	FinaleShow      *FinaleShow
	PremiereShow    *PremiereShow
	PreviouslyShown *PreviouslyShown
}

type Rating

type Rating struct {
	XMLName string `xml:"rating"`
	Value   string `xml:",chardata"`
}

type Subtitle

type Subtitle struct {
	XMLName  string `xml:"sub-title"`
	Language string `xml:"lang,attr,omitempty"`
	Value    string `xml:",chardata"`
}

type Subtitles

type Subtitles struct {
	XMLName string `xml:"subtitle"`
	Type    string `xml:"type,attr,omitempty"`
}

type TVGuide

type TVGuide struct {
	XMLName           string `xml:"tv"`
	Language          string `xml:"-"`
	SourceInfoURL     string `xml:"source-info-url,attr"`
	SourceInfoName    string `xml:"source-info-name,attr"`
	GeneratorInfoName string `xml:"generator-info-name,attr"`
	GeneratorInfoURL  string `xml:"generator-info-url,attr"`
	Channels          []*Channel
	Programs          []*Program
}

func CreateTVGuide

func CreateTVGuide(language string) *TVGuide

func (*TVGuide) AddChannel

func (tvg *TVGuide) AddChannel(channel zap2it.ChannelResponse)

func (*TVGuide) AddEvent

func (tvg *TVGuide) AddEvent(event zap2it.EventResponse)

func (*TVGuide) ChannelExists

func (tvg *TVGuide) ChannelExists(id string) bool

func (*TVGuide) Render

func (tvg *TVGuide) Render() (string, error)

type Title

type Title struct {
	XMLName  string `xml:"title"`
	Language string `xml:"lang,attr,omitempty"`
	Value    string `xml:",chardata"`
}

Jump to

Keyboard shortcuts

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