-
Notifications
You must be signed in to change notification settings - Fork 1
/
types.go
69 lines (59 loc) · 1.5 KB
/
types.go
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
package main
import (
"io"
"regexp"
"text/template"
)
type Stats struct {
Processed, Saved, Failed, Repeated int
CopiedBytes int64
}
type Options struct {
After, Sort, UserAgent, Folder string
EntriesLimit, MaxFiles, MinScore int
Debug, DryRun, AllowSpecialChars bool
MaxStorage, MaxSize int64
OgType string
DataOutputFile io.WriteCloser
DataOutputFormat *template.Template
TemplateFilter *template.Template
FilenameFormat *template.Template
PrintPostData bool
TitleContains, TitleNotContains *regexp.Regexp
FlairContains, FlairNotContains *regexp.Regexp
LinkContains, LinkNotContains *regexp.Regexp
Search string
DownloadPreview bool
PreferPreview bool
PreviewRes int
}
type ImagePreviewEntry struct {
Url string
Width int
Height int
}
type ImagePreview struct {
Source ImagePreviewEntry
Resolutions []ImagePreviewEntry
}
type PostData struct {
Url, Name, Title, Id string
Score int
Subreddit, Author string
LinkFlairText string
CreatedUtc int64
Preview struct {
Images []ImagePreview
}
}
type Post struct {
Data PostData
}
type ApiData struct {
After string
Children []Post
}
type ApiResponse struct {
Data ApiData
}
type PostHandler func(post PostData, postMap map[string]any)