mirror of
https://github.com/nabbar/golib.git
synced 2025-10-13 03:23:47 +08:00
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:
@@ -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 ""
|
||||
|
Reference in New Issue
Block a user