Versions in this module Expand all Collapse all v0 v0.8.0 Jul 18, 2023 Changes in this version + type InvalidItemError struct + Message string + func (e InvalidItemError) Error() string + type ResponseError struct + Response *http.Response + func (r *ResponseError) Error() string v0.7.5 Oct 25, 2022 v0.7.4 Oct 24, 2022 v0.7.3 Oct 23, 2022 v0.7.2 Oct 8, 2022 v0.7.1 Oct 7, 2022 v0.7.0 Oct 7, 2022 v0.6.1 Oct 7, 2022 v0.6.0 Oct 7, 2022 Changes in this version + const BASE_URL + const USER_AGENT + const Version + func CheckResponse(r *http.Response) error + type Client struct + BaseURL *url.URL + Items *ItemsService + Stories *StoriesService + Updates *UpdatesService + UserAgent string + Users *UsersService + func (c *Client) Do(ctx context.Context, req *http.Request, v any) (*http.Response, error) + func (c *Client) GetHTTPClient() *http.Client + func (c *Client) NewRequest(method, path string) (*http.Request, error) + type ErrInvalidItem struct + Message string + func (e ErrInvalidItem) Error() string + type ErrResponse struct + Response *http.Response + func (r *ErrResponse) Error() string + type ItemsService service + func (s *ItemsService) FetchAllDescendants(ctx context.Context, item *Item, fn ItemProcessor) (ItemsIndex, error) + func (s *ItemsService) Get(ctx context.Context, id int) (*Item, error) + func (s *ItemsService) GetIDsFromURL(ctx context.Context, url string) ([]*int, error) + func (s *ItemsService) GetMaxID(ctx context.Context) (*int, error) + func (s *ItemsService) GetStoryIdFromComment(ctx context.Context, item *Item) (*int, error) + type StoriesService service + func (s *StoriesService) GetAskIDs(ctx context.Context) ([]*int, error) + func (s *StoriesService) GetBestIDs(ctx context.Context) ([]*int, error) + func (s *StoriesService) GetIDsFromURL(ctx context.Context, url string) ([]*int, error) + func (s *StoriesService) GetJobIDs(ctx context.Context) ([]*int, error) + func (s *StoriesService) GetNewIDs(ctx context.Context) ([]*int, error) + func (s *StoriesService) GetShowIDs(ctx context.Context) ([]*int, error) + func (s *StoriesService) GetTopIDs(ctx context.Context) ([]*int, error) type Story + Parent *Item + type UpdatesService service + func (s UpdatesService) Get(ctx context.Context) (*Update, error) + type UsersService service + func (s *UsersService) GetByUsername(ctx context.Context, username string) (*User, error) v0.5.0 Oct 4, 2022 Changes in this version type Item + Position int type Story + func (s *Story) GetOrderedCommentsIDs() []int + func (s *Story) SetCommentsPosition() v0.4.0 Oct 4, 2022 Changes in this version type Item + Order int + type ItemsIndex map[int]Item + type Story struct + CommentsByIdMap ItemsIndex + StoryItem Item + func (s *Story) CalculateCommentsOrder() + func (s Story) IsTopLevelComment(item Item) bool v0.3.0 Oct 3, 2022 Changes in this version + const ASK_STORIES_URL + const BEST_STORIES_URL + const ITEM_URL + const JOB_STORIES_URL + const MAX_ITEM_ID_URL + const NEW_STORIES_URL + const SHOW_STORIES_URL + const TOP_STORIES_URL + const UPDATES_URL + const USER_URL + func NewClient(ctx context.Context, httpClient HTTPClient) *client + func NewClientWithContext(ctx context.Context, httpClient HTTPClient) *client + func NewDefaultClient() *client + func NewDefaultClientWithContext(ctx context.Context) *client + type HTTPClient interface + Do func(req *http.Request) (*http.Response, error) + type Item struct + By string + Dead bool + Deleted bool + Descendants int + ID int + Kids []int + Parent int + Parts []int + Poll int + Score int + Text string + Time int + Title string + Type string + URL string + type ItemProcessor func(*Item) error + type Update struct + Items []int + Profiles []string + type User struct + About string + Created int + ID string + Karma int + Submitted []int