Versions in this module Expand all Collapse all v0 v0.2.1 Jun 14, 2026 v0.2.0 Jun 14, 2026 Changes in this version + const Host type Client + func (c *Client) AskStories(ctx context.Context, limit int) ([]Item, error) + func (c *Client) BestStories(ctx context.Context, limit int) ([]Item, error) + func (c *Client) GetItem(ctx context.Context, id int) (*Item, error) + func (c *Client) GetUser(ctx context.Context, id string) (*User, error) + func (c *Client) JobStories(ctx context.Context, limit int) ([]Item, error) + func (c *Client) NewStories(ctx context.Context, limit int) ([]Item, error) + func (c *Client) ShowStories(ctx context.Context, limit int) ([]Item, error) + func (c *Client) TopStories(ctx context.Context, limit int) ([]Item, error) + type Domain struct + func (Domain) Classify(input string) (uriType, id string, err error) + func (Domain) Info() kit.DomainInfo + func (Domain) Locate(uriType, id string) (string, error) + func (Domain) Register(app *kit.App) + type Item struct + By string + Dead bool + Deleted bool + Descendants int + ID int + Kids []int + Score int + Text string + Time int64 + Title string + Type string + URL string type User + ID string v0.1.1 Jun 14, 2026 Changes in this version + type Change struct + Kind string + URL string + Value string type Updates + func (u Updates) Changes() []Change v0.1.0 Jun 13, 2026 Changes in this version + const DefaultUserAgent + var ErrNotFound = errors.New("not found") + func ParseItemID(s string) (int, error) + func ParseUsername(s string) (string, error) + type Client struct + func NewClient(cfg Config) *Client + func (c *Client) Item(ctx context.Context, id int, depth int) (Story, []Comment, error) + func (c *Client) MaxItem(ctx context.Context) (int, error) + func (c *Client) Search(ctx context.Context, opts SearchOptions) ([]SearchHit, error) + func (c *Client) StoryList(ctx context.Context, endpoint string, limit int) ([]Story, error) + func (c *Client) Updates(ctx context.Context) (Updates, error) + func (c *Client) User(ctx context.Context, username string) (User, []int, error) + func (c *Client) UserSubmissions(ctx context.Context, ids []int, limit int) ([]Story, error) + type Comment struct + By string + Date string + Depth int + HNURL string + ID int + Parent int + Text string + Time int64 + type Config struct + Rate time.Duration + Retries int + Timeout time.Duration + UserAgent string + Workers int + func DefaultConfig() Config + type SearchHit struct + By string + Comments int + Date string + HNURL string + ID int + Rank int + Score int + StoryID int + StoryTitle string + Text string + Time int64 + Title string + Type string + URL string + type SearchOptions struct + Limit int + MinComments int + MinPoints int + Query string + Since string + Sort string + Tags string + type Story struct + By string + Comments int + Date string + HNURL string + ID int + Rank int + Score int + Text string + Time int64 + Title string + Type string + URL string + type Updates struct + Items []int + Profiles []string + type User struct + About string + Created int64 + CreatedDate string + Karma int + Submitted int + URL string + Username string