summaryrefslogtreecommitdiff
path: root/struct.go
blob: 568205eb5d9d9346e895fa4eea0ea5e78f85d389 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package main

import (
	"sync"
)

type Story struct {
	Id int
	//Deleted     	bool
	Type  string /* story, comment (or job, poll, pollopt) */
	Title string /* title (only story) */
	Text  string /* comment text or possible text on story (HTML) */
	Dead  bool
	Url   string /* verbatim parsed URL */
	//NormalizedUrl   string	/* normalized */
	Score       int /* only story */
	Descendants int /* comments on score or kids on comments */
	//Kids		[]int	/* id of the item's comments  */
	Time  int    /* posted at */
	By    string /* hn commenter */
	Links []Link /* matched urls */
}

type Link struct {
	Url   string
	Field int    /* 2 = video, 1 = movies, 0 = bug */
	Host  string /* e.g. "youtube.com", "imdb.com" */
	Param string /* e.g. "v" param for youtube, title/"ttxxx" for imdb */
	Type  string /* e.g. "video", "channel", "playlist" */
}

type URL struct {
}

type syncMaxItem struct {
	max_item int
	mu       sync.Mutex
}