-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstructs.go
112 lines (94 loc) · 2.31 KB
/
structs.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
package main
// Our config data
type serverConfigData struct {
Version string
CommunityName string
ServerListURL string
PathData filePathData
ServerPrefs serverPrefs
WebServer webServerConfigData
}
type serverPrefs struct {
AutoSubscribe bool
RequireReason bool
StripReasons bool
MaxBanOutputCount int
WatchFileSeconds int
FetchBansMinutes int
RefreshListHours int
DownloadTimeoutSeconds int
DownloadSizeLimitKB int64
VerboseLogging bool
}
type filePathData struct {
FactorioBanFile string
FactorioWhitelist string
ServerListFile string
CompositeBanFile string
LogDir string
BanCacheDir string
}
type webServerConfigData struct {
RunWebServer bool
DomainName string
SSLWebPort int
SSLKeyFile string
SSLCertFile string
MaxRequestsPerSecond int
}
// List of servers
type serverListData struct {
Version string
ServerList []serverData
}
// Server data
type serverData struct {
CommunityName string `json:"Name"`
BanListURL string `json:"Bans"`
WhiteListURL string `json:"Trusts,omitempty"`
LogFileURL string `json:"Logs,omitempty"`
WebsiteURL string `json:"Website,omitempty"`
DiscordURL string `json:"Discord,omitempty"`
JsonGzip bool `json:",omitempty"`
UseRedScrape bool `json:",omitempty"`
UseComfyScrape bool `json:",omitempty"`
LocalData localData
}
type localData struct {
Subscribed bool `json:",omitempty"`
StripReasons bool `json:",omitempty"`
Added string `json:",omitempty"`
BanList []banDataType `json:"-"`
}
// Minimal ban data
type minBanDataType struct {
UserName string `json:"username"`
Reason string `json:"reason"`
}
// Ban data
type banDataType struct {
UserName string `json:"username"`
Reason string `json:"reason,omitempty"`
Revoked bool `json:",omitempty"`
Added string `json:",omitempty"`
Sources []string `json:",omitempty"`
Reasons []string `json:",omitempty"`
Revokes []bool `json:",omitempty"`
Adds []string `json:",omitempty"`
}
// RCON list
type RCONDataList struct {
RCONData []RCONData
}
// RCON data
type RCONData struct {
RCONName string
RCONAddress string
RCONPassword string
}
// Log monitor data
type LogMonitorData struct {
Name string
File string
Path string
}