@@ -15,8 +15,8 @@ type Config struct {
1515}
1616
1717type LoggerConfig struct {
18- Level string `mapstructure:"level"`
19- Format string `mapstructure:"format"`
18+ Level string `mapstructure:"level"`
19+ Format string `mapstructure:"format"`
2020 OutputPaths []string `mapstructure:"output_paths"`
2121}
2222
@@ -46,18 +46,18 @@ type WorkerConfig struct {
4646}
4747
4848type TelemetryConfig struct {
49- Enabled bool `mapstructure:"enabled"`
50- ServiceName string `mapstructure:"service_name"`
51- ExporterType string `mapstructure:"exporter_type"`
52- Endpoint string `mapstructure:"endpoint"`
49+ Enabled bool `mapstructure:"enabled"`
50+ ServiceName string `mapstructure:"service_name"`
51+ ExporterType string `mapstructure:"exporter_type"`
52+ Endpoint string `mapstructure:"endpoint"`
5353 SampleRate float64 `mapstructure:"sample_rate"`
5454}
5555
5656type SecurityConfig struct {
57- RateLimit RateLimitConfig `mapstructure:"rate_limit"`
58- ScopeFile string `mapstructure:"scope_file"`
59- APIKey string `mapstructure:"api_key"`
60- EnableAuth bool `mapstructure:"enable_auth"`
57+ RateLimit RateLimitConfig `mapstructure:"rate_limit"`
58+ ScopeFile string `mapstructure:"scope_file"`
59+ APIKey string `mapstructure:"api_key"`
60+ EnableAuth bool `mapstructure:"enable_auth"`
6161}
6262
6363type RateLimitConfig struct {
@@ -84,9 +84,9 @@ type NmapConfig struct {
8484}
8585
8686type SSLConfig struct {
87- Timeout time.Duration `mapstructure:"timeout"`
88- FollowRedirects bool `mapstructure:"follow_redirects"`
89- CheckRevocation bool `mapstructure:"check_revocation"`
87+ Timeout time.Duration `mapstructure:"timeout"`
88+ FollowRedirects bool `mapstructure:"follow_redirects"`
89+ CheckRevocation bool `mapstructure:"check_revocation"`
9090}
9191
9292type ZAPConfig struct {
@@ -144,43 +144,43 @@ func (c *Config) Validate() error {
144144 if c .Logger .Level == "" {
145145 c .Logger .Level = "info"
146146 }
147-
147+
148148 if c .Logger .Format == "" {
149149 c .Logger .Format = "json"
150150 }
151-
151+
152152 if c .Database .Driver == "" {
153153 c .Database .Driver = "sqlite3"
154154 }
155-
155+
156156 if c .Redis .Addr == "" {
157157 c .Redis .Addr = "localhost:6379"
158158 }
159-
159+
160160 if c .Worker .Count < 1 {
161161 c .Worker .Count = 1
162162 }
163-
163+
164164 if c .Worker .QueuePollInterval == 0 {
165165 c .Worker .QueuePollInterval = 5 * time .Second
166166 }
167-
167+
168168 if c .Security .RateLimit .RequestsPerSecond == 0 {
169169 c .Security .RateLimit .RequestsPerSecond = 10
170170 }
171-
171+
172172 if c .Telemetry .ServiceName == "" {
173173 c .Telemetry .ServiceName = "shells"
174174 }
175-
175+
176176 return nil
177177}
178178
179179func DefaultConfig () * Config {
180180 return & Config {
181181 Logger : LoggerConfig {
182- Level : "info" ,
183- Format : "json" ,
182+ Level : "info" ,
183+ Format : "json" ,
184184 OutputPaths : []string {"stdout" },
185185 },
186186 Database : DatabaseConfig {
@@ -263,4 +263,4 @@ func DefaultConfig() *Config {
263263 },
264264 },
265265 }
266- }
266+ }
0 commit comments