mirror of
https://github.com/crowdsecurity/crowdsec.git
synced 2025-05-11 12:25:53 +02:00
parent
5f339ab312
commit
dbb420f79e
563 changed files with 64363 additions and 10714 deletions
21
pkg/csconfig/simulation.go
Normal file
21
pkg/csconfig/simulation.go
Normal file
|
@ -0,0 +1,21 @@
|
|||
package csconfig
|
||||
|
||||
type SimulationConfig struct {
|
||||
Simulation *bool `yaml:"simulation"`
|
||||
Exclusions []string `yaml:"exclusions,omitempty"`
|
||||
}
|
||||
|
||||
func (s *SimulationConfig) IsSimulated(scenario string) bool {
|
||||
var simulated bool
|
||||
|
||||
if s.Simulation != nil && *s.Simulation {
|
||||
simulated = true
|
||||
}
|
||||
for _, excluded := range s.Exclusions {
|
||||
if excluded == scenario {
|
||||
simulated = !simulated
|
||||
break
|
||||
}
|
||||
}
|
||||
return simulated
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue