client

package
v0.0.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 15, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetTopStories

func GetTopStories() ([]int, error)

Types

type Item

type Item struct {
	Id       int    `json:"id"`
	Type     string `json:"type"`
	By       string `json:"by"`
	Time     int    `json:"time"`
	Title    string `json:"title"`
	Text     string `json:"text"`
	Url      string `json:"url"`
	Score    int    `json:"score"`
	Kids     []int  `json:"kids"`
	Comments []Item `json:"comments"`
}

func GetItem

func GetItem(itemId int) (Item, error)

func GetItemWithComments

func GetItemWithComments(itemId, maxComments int) (Item, error)

type TopMenuResponse

type TopMenuResponse struct {
	Items []Item `json:"items"`
}

func GetTopMenuResponse

func GetTopMenuResponse() (TopMenuResponse, error)

Returns the top menu response with the top stories as items with only their IDs

func (TopMenuResponse) EnrichItems

func (t TopMenuResponse) EnrichItems(pageSize, page int)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL