-
Notifications
You must be signed in to change notification settings - Fork 1
/
configtypes.go
169 lines (146 loc) · 5.03 KB
/
configtypes.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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
/*
* Copyright ADH Partnership
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package config
type Config struct {
Database ConfigDatabase `json:"database"`
Discord ConfigDiscord `json:"discord"`
Email ConfigEmail `json:"email"`
Facility ConfigFacility `json:"facility"`
Features ConfigFeatures `json:"features"`
Groups map[string][]string `json:"groups"`
Metrics ConfigMetrics `json:"metrics"`
OAuth ConfigOAuth `json:"oauth"`
Server ConfigServer `json:"server"`
Session ConfigSession `json:"session"`
Storage ConfigStorage `json:"storage"`
VATUSA ConfigVATUSA `json:"vatusa"`
}
type ConfigServer struct {
Host string `json:"host"`
Port string `json:"port"`
}
type ConfigDiscord struct {
Webhooks map[string]string `json:"webhooks"`
ClientID string `json:"client_id"`
ClientSecret string `json:"client_secret"`
}
type ConfigDatabase struct {
Host string `json:"host"`
Port string `json:"port"`
User string `json:"user"`
Password string `json:"password"`
Database string `json:"database"`
Automigrate bool `json:"automigrate"`
CACert string `json:"ca_cert"`
}
type ConfigEmail struct {
Host string `json:"host"`
Port string `json:"port"`
User string `json:"user"`
Password string `json:"password"`
From string `json:"from"`
TemplateDir string `json:"template_dir"`
}
type ConfigFeatures struct {
StaffingRequest bool `json:"staffing_request"`
ControllerOnline bool `json:"controller_online"`
IgnoreUnknownController bool `json:"ignore_unknown_controller"`
}
type ConfigSession struct {
Cookie ConfigSessionCookie `json:"cookie"`
}
type ConfigSessionCookie struct {
Name string `json:"name"`
Secret string `json:"secret"`
Domain string `json:"domain"`
Path string `json:"path"`
MaxAge int `json:"max_age"`
Secure bool `json:"secure"`
SameSite string `json:"same_site"`
}
type ConfigOAuth struct {
BaseURL string `json:"base_URL"`
ClientID string `json:"client_id"`
ClientSecret string `json:"client_secret"`
MyBaseURL string `json:"my_base_URL"`
Endpoints ConfigOAuthEndpoints `json:"endpoints"`
}
type ConfigOAuthEndpoints struct {
Authorize string `json:"authorize"`
Token string `json:"token"`
UserInfo string `json:"user"`
}
type ConfigVATUSA struct {
Facility string `json:"facility"`
APIKey string `json:"api_key"`
TestMode bool `json:"test_mode"`
}
type ConfigStorage struct {
BaseURL string `json:"base_URL"`
AccessKey string `json:"access_key"`
SecretKey string `json:"secret_key"`
Bucket string `json:"bucket"`
Region string `json:"region"`
Endpoint string `json:"endpoint"`
}
type ConfigFacility struct {
Activity ConfigFacilityActivity `json:"activity"`
Stats ConfigFacilityStats `json:"stats"`
Visiting ConfigFacilityVisiting `json:"visiting"`
TrainingRequests ConfigFacilityTraining `json:"training_requests"`
FrontendURL string `json:"frontend_url"`
}
type ConfigFacilityTraining struct {
Enabled bool `json:"enabled"`
Discord ConfigFacilityTrainingDiscord `json:"discord"`
Positions []string `json:"positions"`
MaxRequestsPerUser int `json:"max_requests_per_user"`
SendToDiscord bool `json:"send_to_discord"`
}
type ConfigFacilityTrainingDiscord struct {
TrainingStaff string `json:"training_staff"`
Scheduled string `json:"scheduled"`
ShowAllScheduled bool `json:"show_all_scheduled"`
}
type ConfigFacilityStats struct {
Enabled bool `json:"enabled"`
Prefixes []string `json:"prefixes"`
}
type ConfigFacilityVisiting struct {
SendWelcome bool `json:"send_welcome"`
SendRemoval bool `json:"send_removal"`
SendRejected bool `json:"send_rejected"`
}
type ConfigFacilityActivity struct {
Inactive ConfigFacilityActivityInactive `json:"inactive"`
Warning ConfigFacilityActivityWarning `json:"warning"`
}
type ConfigFacilityActivityWarning struct {
Enabled bool `json:"enabled"`
DaysBefore int `json:"days_before"`
Months []int `json:"months"`
}
type ConfigFacilityActivityInactive struct {
Enabled bool `json:"enabled"`
Period int `json:"period"`
MinHours int `json:"min_hours"`
Months []int `json:"months"`
}
type ConfigMetrics struct {
Enabled bool `json:"enabled"`
Port int `json:"port"`
Path string `json:"path"`
}