Documentation ¶
Overview ¶
Package gonhk implements a NHK API client.
Index ¶
- type Client
- func (c *Client) NowOnAir(version, area, service string) (*NhkNowOnAirList, error)
- func (c *Client) ProgramGenre(version, area, service, genre string, date time.Time) (*NhkList, error)
- func (c *Client) ProgramInfo(version, area, service, id string) (*NhkDescriptionList, error)
- func (c *Client) ProgramList(version, area, service string, date time.Time) (*NhkList, error)
- type NhkArea
- type NhkDescription
- type NhkDescriptionList
- type NhkError
- type NhkExtra
- type NhkLink
- type NhkList
- type NhkLogo
- type NhkNowOnAir
- type NhkNowOnAirList
- type NhkProgram
- type NhkService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
A Client represents a NHK API client.
func (*Client) NowOnAir ¶
func (c *Client) NowOnAir(version, area, service string) (*NhkNowOnAirList, error)
NowOnAir calls NHK Now On Air API and returns its result.
func (*Client) ProgramGenre ¶
func (c *Client) ProgramGenre(version, area, service, genre string, date time.Time) (*NhkList, error)
ProgramGenre calls NHK Program Genre API and returns its result.
func (*Client) ProgramInfo ¶
func (c *Client) ProgramInfo(version, area, service, id string) (*NhkDescriptionList, error)
ProgramInfo calls NHK Program Info API and returns its result.
type NhkDescription ¶
type NhkDescription struct { Id string `json:"id"` EventId string `json:"event_id"` StartTime time.Time `json:"start_time"` EndTime time.Time `json:"end_time"` Area NhkArea `json:"area"` Service NhkService `json:"service"` Title string `json:"title"` Subtitle string `json:"subtitle"` Genres []string `json:"genres"` ProgramLogo NhkLogo `json:"program_logo"` ProgramUrl string `json:"program_url"` EpisodeUrl string `json:"episode_url"` Extras NhkExtra `json:"extras"` }
An NhkDescription represents a description data of NHK API.
type NhkDescriptionList ¶
type NhkDescriptionList struct {
List map[string][]*NhkDescription `json:"list"`
}
An NhkDescriptionList represents a description list data of NHK API.
type NhkExtra ¶
type NhkExtra struct { OndemandProgram NhkLink `json:"ondemand_program"` OndemandEpisode NhkLink `json:"ondemand_episode"` }
An NhkExtra represents an extra data of NHK API.
type NhkList ¶
type NhkList struct {
List map[string][]*NhkProgram `json:"list"`
}
An NhkList represents a list data of NHK API.
type NhkLogo ¶
type NhkLogo struct { Url string `json:"url"` Width string `json:"width"` Height string `json:"height"` }
An NhkLogo represents a logo data of NHK API.
type NhkNowOnAir ¶
type NhkNowOnAir struct { Previous NhkProgram `json:"previous"` Present NhkProgram `json:"present"` Following NhkProgram `json:"following"` }
An NhkNowOnAir represents a now on air data of NHK API.
type NhkNowOnAirList ¶
type NhkNowOnAirList struct {
NowOnAirList map[string]*NhkNowOnAir `json:"nowonair_list"`
}
An NhkNowOnAirList represents a now on air list data of NHK API.
type NhkProgram ¶
type NhkProgram struct { Id string `json:"id"` EventId string `json:"event_id"` StartTime time.Time `json:"start_time"` EndTime time.Time `json:"end_time"` Area NhkArea `json:"area"` Service NhkService `json:"service"` Title string `json:"title"` Subtitle string `json:"subtitle"` Genres []string `json:"genres"` }
An NhkProgram represents a program data of NHK API.