Now checking for a feature flag is a one liner, with no need to control errors. if fflag.Crowdsec.CscliSetup.IsEnabled() { ... }
15 lines
255 B
Go
15 lines
255 B
Go
package fflag
|
|
|
|
var Crowdsec = FeatureRegister{EnvPrefix: "CROWDSEC_FEATURE_"}
|
|
|
|
var CscliSetup = &Feature{Name: "cscli_setup"}
|
|
|
|
func RegisterAllFeatures() error {
|
|
err := Crowdsec.RegisterFeature(CscliSetup)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|