Documentation ¶
Index ¶
- Constants
- Variables
- func ChannelHandler(w http.ResponseWriter, r *http.Request, params martini.Params)
- func InitAPI(userAgentIn string)
- func ProgrammeHandler(w http.ResponseWriter, r *http.Request, params martini.Params)
- type APIResponse
- type Channel
- type ChannelDay
- type ChannelRequest
- type DataList
- type Programme
- type ProgrammeRequest
- type TimeList
Constants ¶
View Source
const ( BaseURL = "http://xml.oztivo.net/xmltv/" DataListFile = BaseURL + "datalist.xml.gz" )
Variables ¶
View Source
var (
ResponseLimit int = 500
)
Functions ¶
func ChannelHandler ¶
Handle HTTP requests for channels
func ProgrammeHandler ¶
Handle HTTP requests for programmes
Types ¶
type APIResponse ¶
type APIResponse struct { Error string `json:"error,omitempty"` Data interface{} `json:"data,omitempty"` }
type Channel ¶
type Channel struct { Id string `xml:"id,attr" json:"id"` DisplayName struct { Text string `xml:",innerxml" json:"text"` Lang string `xml:"lang,attr" json:"lang"` } `xml:"display-name" json:"display_name"` BaseURL []string `xml:"base-url" json:"-"` DataFor []string `xml:"datafor" json:"-"` DataForT TimeList `xml:"-" json:"-"` }
type ChannelDay ¶
type ChannelRequest ¶
type Programme ¶
type Programme struct { StartTime string `xml:"start,attr" json:"-"` StopTime string `xml:"stop,attr" json:"-"` StartTimeJ time.Time `xml:"-" json:"start_time"` StopTimeJ time.Time `xml:"-" json:"stop_time"` Title string `xml:"title" json:"title"` SubTitle string `xml:"sub-title" json:"subtitle"` Description string `xml:"desc" json:"description"` Credits []struct { Actor string `xml:"actor" json:"actor,omitempty"` } `xml:"credits" json:"credits,omitempty"` Category []string `xml:"category" json:"category,omitempty"` Rating []struct { Value string `xml:"value" json:"value,omitempty"` } `xml:"rating" json:"rating,omitempty"` StarRating []struct { Value string `xml:"value" json:"value,omitempty"` } `xml:"star-rating" json:"star_rating,omitempty"` }
type ProgrammeRequest ¶
Click to show internal directories.
Click to hide internal directories.