Add Validator from github.com/go-playground/validator for LDAP config

Add error function to check if there are any parent error
This commit is contained in:
Nicolas JUHEL
2020-08-23 13:14:27 +02:00
parent 59070d0694
commit fbed8f5216
4 changed files with 40 additions and 7 deletions

View File

@@ -45,6 +45,7 @@ const (
ErrorLDAPInvalidUID
ErrorLDAPAttributeNotFound
ErrorLDAPAttributeEmpty
ErrorLDAPValidatorError
)
var isCodeError = false
@@ -94,6 +95,8 @@ func getMessage(code errors.CodeError) (message string) {
return "requested attribute is not found"
case ErrorLDAPAttributeEmpty:
return "requested attribute is empty"
case ErrorLDAPValidatorError:
return "invalid validation config"
}
return ""