Skip to content
Snippets Groups Projects
Commit a6529311 authored by ale's avatar ale
Browse files

Add ParseScope function

parent 3e38f41a
No related branches found
No related tags found
No related merge requests found
package ldaputil
import (
"fmt"
"gopkg.in/ldap.v2"
)
func ParseScope(s string) (int, error) {
switch s {
case "base":
return ldap.ScopeBaseObject, nil
case "one":
return ldap.ScopeSingleLevel, nil
case "sub":
return ldap.ScopeWholeSubtree, nil
default:
return 0, fmt.Errorf("unknown LDAP scope '%s'", s)
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment