hn

package
v0.0.0-...-5428a2e Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Intermediate layer between the Hacker News API and the application

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FetchStoryIds

func FetchStoryIds(category, query string, frame [2]int) (ids []int, err error)

FetchStoryIds fetches a list of story ids from the Hacker News API

Types

type Comment

type Comment struct {
	Text     string `json:"text"`
	User     string `json:"by"`
	Time     int    `json:"time"`
	Points   int    `json:"score"`
	Deleted  bool   `json:"deleted"`
	Children []int  `json:"kids"`
}

func FetchComment

func FetchComment(id int) (comment Comment, err error)

FetchComment fetches a comment from the Hacker News API

type Story

type Story struct {
	Title    string `json:"title"`
	URL      string `json:"url"`
	User     string `json:"by"`
	Time     int    `json:"time"`
	Points   int    `json:"score"`
	Comments int    `json:"descendants"`
	Children []int  `json:"kids"`
}

func FetchStory

func FetchStory(id int) (story Story, err error)

FetchStory fetches a story from the Hacker News API

Jump to

Keyboard shortcuts

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