- Fix LDAP Connection (following bump libldap)

- Add context managment
This commit is contained in:
Nicolas JUHEL
2020-08-12 09:14:14 +02:00
parent f616e983e0
commit 0b35fb4540
2 changed files with 119 additions and 41 deletions

View File

@@ -30,6 +30,7 @@ import "github.com/nabbar/golib/errors"
const (
EMPTY_PARAMS errors.CodeError = iota + errors.MIN_PKG_LDAP
LDAP_CONTEXT_ERROR
LDAP_SERVER_CONFIG
LDAP_SERVER_DIAL
LDAP_SERVER_TLS
@@ -55,6 +56,8 @@ func getMessage(code errors.CodeError) (message string) {
switch code {
case EMPTY_PARAMS:
return "given parameters is empty"
case LDAP_CONTEXT_ERROR:
return "LDAP server connection context occurs an error"
case LDAP_SERVER_CONFIG:
return "LDAP server config is not well defined"
case LDAP_SERVER_DIAL: