Documentation ¶
Overview ¶
Package guideproviders is a telly internal package to provide electronic program guide (EPG) data. It is generally modeled after the XMLTV standard with slight deviations to accommodate other providers.
Index ¶
- type AvailableLineup
- type Channel
- type Configuration
- type CoverageArea
- type GuideProvider
- type Logo
- type ProgrammeContainer
- type SchedulesDirect
- func (s *SchedulesDirect) AvailableLineups(countryCode, postalCode string) ([]AvailableLineup, error)
- func (s *SchedulesDirect) Channels() ([]Channel, error)
- func (s *SchedulesDirect) Configuration() Configuration
- func (s *SchedulesDirect) LineupCoverage() ([]CoverageArea, error)
- func (s *SchedulesDirect) Name() string
- func (s *SchedulesDirect) PreviewLineupChannels(lineupID string) ([]Channel, error)
- func (s *SchedulesDirect) Refresh(lastStatusJSON *json.RawMessage) ([]byte, error)
- func (s *SchedulesDirect) Schedule(daysToGet int, inputChannels []Channel, inputProgrammes []ProgrammeContainer) (map[string]interface{}, []ProgrammeContainer, error)
- func (s *SchedulesDirect) SubscribeToLineup(lineupID string) (interface{}, error)
- func (s *SchedulesDirect) SupportsLineups() bool
- func (s *SchedulesDirect) UnsubscribeFromLineup(lineupID string) error
- type XMLTV
- func (x *XMLTV) AvailableLineups(countryCode, postalCode string) ([]AvailableLineup, error)
- func (x *XMLTV) Channels() ([]Channel, error)
- func (x *XMLTV) Configuration() Configuration
- func (x *XMLTV) LineupCoverage() ([]CoverageArea, error)
- func (x *XMLTV) Name() string
- func (x *XMLTV) PreviewLineupChannels(lineupID string) ([]Channel, error)
- func (x *XMLTV) Refresh(lastStatusJSON *json.RawMessage) ([]byte, error)
- func (x *XMLTV) Schedule(daysToGet int, inputChannels []Channel, inputProgrammes []ProgrammeContainer) (map[string]interface{}, []ProgrammeContainer, error)
- func (x *XMLTV) SubscribeToLineup(lineupID string) (interface{}, error)
- func (x *XMLTV) SupportsLineups() bool
- func (x *XMLTV) UnsubscribeFromLineup(providerID string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AvailableLineup ¶
AvailableLineup is a lineup that a user can subscribe to.
type Channel ¶
type Channel struct { // Required Fields ID string `json:",omitempty"` Name string `json:",omitempty"` Logos []Logo `json:",omitempty"` Number string `json:",omitempty"` // Optional fields CallSign string `json:",omitempty"` URLs []string `json:",omitempty"` Lineup string `json:",omitempty"` Affiliate string `json:",omitempty"` ProviderData interface{} `json:",omitempty"` }
Channel describes a channel available in the providers lineup with necessary pieces parsed into fields.
type Configuration ¶
type Configuration struct { Name string `json:"-"` Provider string // Only used for Schedules Direct provider Username string Password string Lineups []string // Only used for XMLTV provider XMLTVURL string }
Configuration is the basic configuration struct for guideproviders with generic values for specific providers.
func (*Configuration) GetProvider ¶
func (i *Configuration) GetProvider() (GuideProvider, error)
GetProvider returns an initialized GuideProvider for the Configuration.
type CoverageArea ¶
type CoverageArea struct { RegionName string `json:",omitempty"` FullName string `json:",omitempty"` PostalCode string `json:",omitempty"` PostalCodeExample string `json:",omitempty"` ShortName string `json:",omitempty"` OnePostalCode bool `json:",omitempty"` }
CoverageArea describes a region that a provider supports.
type GuideProvider ¶
type GuideProvider interface { Name() string Channels() ([]Channel, error) Schedule(daysToGet int, inputChannels []Channel, inputProgrammes []ProgrammeContainer) (map[string]interface{}, []ProgrammeContainer, error) Refresh(lastStatusJSON *json.RawMessage) ([]byte, error) Configuration() Configuration // Schedules Direct specific functions that others might someday use. SupportsLineups() bool LineupCoverage() ([]CoverageArea, error) AvailableLineups(countryCode, postalCode string) ([]AvailableLineup, error) PreviewLineupChannels(lineupID string) ([]Channel, error) SubscribeToLineup(lineupID string) (interface{}, error) UnsubscribeFromLineup(providerID string) error }
GuideProvider describes a IPTV provider configuration.
type ProgrammeContainer ¶
ProgrammeContainer contains information about a single provider in the XMLTV format as well as provider specific data.
type SchedulesDirect ¶
type SchedulesDirect struct { BaseConfig Configuration // contains filtered or unexported fields }
SchedulesDirect is a GuideProvider supporting the Schedules Direct JSON service.
func (*SchedulesDirect) AvailableLineups ¶
func (s *SchedulesDirect) AvailableLineups(countryCode, postalCode string) ([]AvailableLineup, error)
AvailableLineups will return a slice of AvailableLineup for the given countryCode and postalCode.
func (*SchedulesDirect) Channels ¶
func (s *SchedulesDirect) Channels() ([]Channel, error)
Channels returns a slice of Channel that the provider has available.
func (*SchedulesDirect) Configuration ¶
func (s *SchedulesDirect) Configuration() Configuration
Configuration returns the base configuration backing the provider.
func (*SchedulesDirect) LineupCoverage ¶
func (s *SchedulesDirect) LineupCoverage() ([]CoverageArea, error)
LineupCoverage returns a map of regions and countries the provider has support for.
func (*SchedulesDirect) Name ¶
func (s *SchedulesDirect) Name() string
Name returns the name of the GuideProvider.
func (*SchedulesDirect) PreviewLineupChannels ¶
func (s *SchedulesDirect) PreviewLineupChannels(lineupID string) ([]Channel, error)
PreviewLineupChannels will return a slice of Channels for the given provider specific lineupID.
func (*SchedulesDirect) Refresh ¶
func (s *SchedulesDirect) Refresh(lastStatusJSON *json.RawMessage) ([]byte, error)
Refresh causes the provider to request the latest information.
func (*SchedulesDirect) Schedule ¶
func (s *SchedulesDirect) Schedule(daysToGet int, inputChannels []Channel, inputProgrammes []ProgrammeContainer) (map[string]interface{}, []ProgrammeContainer, error)
Schedule returns a slice of xmltv.Programme for the given channelIDs.
func (*SchedulesDirect) SubscribeToLineup ¶
func (s *SchedulesDirect) SubscribeToLineup(lineupID string) (interface{}, error)
SubscribeToLineup will subscribe the user to a lineup.
func (*SchedulesDirect) SupportsLineups ¶
func (s *SchedulesDirect) SupportsLineups() bool
SupportsLineups returns true if the provider supports the concept of subscribing to lineups.
func (*SchedulesDirect) UnsubscribeFromLineup ¶
func (s *SchedulesDirect) UnsubscribeFromLineup(lineupID string) error
UnsubscribeFromLineup will remove a lineup from the provider account.
type XMLTV ¶
type XMLTV struct { BaseConfig Configuration // contains filtered or unexported fields }
XMLTV is a GuideProvider supporting XMLTV files.
func (*XMLTV) AvailableLineups ¶
func (x *XMLTV) AvailableLineups(countryCode, postalCode string) ([]AvailableLineup, error)
AvailableLineups will return a slice of AvailableLineup for the given countryCode and postalCode.
func (*XMLTV) Configuration ¶
func (x *XMLTV) Configuration() Configuration
Configuration returns the base configuration backing the provider
func (*XMLTV) LineupCoverage ¶
func (x *XMLTV) LineupCoverage() ([]CoverageArea, error)
LineupCoverage returns a map of regions and countries the provider has support for.
func (*XMLTV) PreviewLineupChannels ¶
PreviewLineupChannels will return a slice of Channels for the given provider specific lineupID.
func (*XMLTV) Refresh ¶
func (x *XMLTV) Refresh(lastStatusJSON *json.RawMessage) ([]byte, error)
Refresh causes the provider to request the latest information.
func (*XMLTV) Schedule ¶
func (x *XMLTV) Schedule(daysToGet int, inputChannels []Channel, inputProgrammes []ProgrammeContainer) (map[string]interface{}, []ProgrammeContainer, error)
Schedule returns a slice of xmltv.Programme for the given channelIDs.
func (*XMLTV) SubscribeToLineup ¶
SubscribeToLineup will subscribe the user to a lineup.
func (*XMLTV) SupportsLineups ¶
SupportsLineups returns true if the provider supports the concept of subscribing to lineups.
func (*XMLTV) UnsubscribeFromLineup ¶
UnsubscribeFromLineup will remove a lineup from the provider account.