/
types.go
39 lines (32 loc) · 988 Bytes
/
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
package config
// TODO: Validation
type Config struct {
Port string `yaml:"port"`
Password string `yaml:"password"`
RootDir string `yaml:"root_dir"`
RootURL string `yaml:"root_url"`
Pages []Page `yaml:"pages"`
}
type Page struct {
Title string `yaml:"title" json:"title"`
SearchConfig SearchConfig `yaml:"search" json:"search"`
}
type SearchProvider string
const (
NYAA SearchProvider = "nyaa"
YTS SearchProvider = "yts"
LIME SearchProvider = "lime"
)
type SearchConfig struct {
Provider SearchProvider `yaml:"provider" json:"provider"`
Categories []Category `yaml:"categories" json:"categories"`
SortBys []SortBy `yaml:"sorts" json:"sorts"`
RootDirs []string `yaml:"root_dirs" json:"root_dirs"`
CustomRootDir string `yaml:"custom_root_dir" json:"custom_root_dir"`
}
type Category Pair
type SortBy Pair
type Pair struct {
Key string `yaml:"key" json:"key"`
Name string `yaml:"name" json:"name"`
}