Documentation ¶
Overview ¶
Package hn provides an HTTP client with methods mapped to https://github.com/HackerNews/API
Index ¶
- type Client
- func (c Client) AskStories() ([]int, error)
- func (c Client) BestStories() ([]int, error)
- func (c Client) Item(id int) (*Item, error)
- func (c Client) JobStories() ([]int, error)
- func (c Client) MaxItem() (int, error)
- func (c Client) NewStories() ([]int, error)
- func (c Client) ShowStories() ([]int, error)
- func (c Client) TopStories() ([]int, error)
- func (c Client) Updates() (*Updates, error)
- func (c Client) User(id string) (*User, error)
- type Item
- type Updates
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client represents the "HN Client" - it's just an http client with a base URL. Methods are mapped to the hackernews firebase API described here: https://github.com/HackerNews/API
func NewClient ¶
NewClient creates an "HN Client". Its methods wrap requests to firebase json API endpoints. If an *http.Client is not provided, an *http.DefaultClient is used.
func (Client) AskStories ¶
func (Client) BestStories ¶
func (Client) JobStories ¶
func (Client) NewStories ¶
func (Client) ShowStories ¶
func (Client) TopStories ¶
type Item ¶
type Item struct { ID int Type string By string Time time.Time Text string Parent int Poll int Kids []int URL *url.URL Score int Title string Parts []int Descendants int Deleted bool Dead bool }
Item is based on https://github.com/HackerNews/API#items
func (*Item) UnmarshalJSON ¶
type Updates ¶
Updates is based on the response example here: https://github.com/HackerNews/API#changed-items-and-profiles
Click to show internal directories.
Click to hide internal directories.