:lips-stick: fix lint

This commit is contained in:
Max Lerebourg
2022-12-04 21:53:33 +01:00
parent 7e9044c41d
commit c311d8357d
+5 -1
View File
@@ -1,3 +1,4 @@
// Package configuration implements plugin Config, default Config values and validation param functions.
package configuration package configuration
import ( import (
@@ -14,6 +15,7 @@ import (
logger "github.com/maxlerebourg/crowdsec-bouncer-traefik-plugin/pkg/logger" logger "github.com/maxlerebourg/crowdsec-bouncer-traefik-plugin/pkg/logger"
) )
// Enums for crowdsec mode
const ( const (
StreamMode = "stream" StreamMode = "stream"
LiveMode = "live" LiveMode = "live"
@@ -54,7 +56,7 @@ func contains(source []string, target string) bool {
return false return false
} }
// CreateConfig creates the default plugin configuration. // New creates the default plugin configuration.
func New() *Config { func New() *Config {
return &Config{ return &Config{
Enabled: false, Enabled: false,
@@ -74,6 +76,7 @@ func New() *Config {
} }
} }
// GetVariable get variable from file and after in the variables gave by user.
func GetVariable(config *Config, key string) (string, error) { func GetVariable(config *Config, key string) (string, error) {
value := "" value := ""
object := reflect.Indirect(reflect.ValueOf(config)) object := reflect.Indirect(reflect.ValueOf(config))
@@ -100,6 +103,7 @@ func GetVariable(config *Config, key string) (string, error) {
return value, nil return value, nil
} }
// ValidateParams validate all the param gave by user.
func ValidateParams(config *Config) error { func ValidateParams(config *Config) error {
if err := validateParamsRequired(config); err != nil { if err := validateParamsRequired(config); err != nil {
return err return err