Documentation ¶
Index ¶
- Variables
- func ConnectionTestWithAllConfig(ldapConfig models.LdapConf, ldapGroupConfig models.LdapGroupConf) error
- func ConnectionTestWithConfig(ldapConfig models.LdapConf) error
- type Session
- func (session *Session) Bind(dn string, password string) error
- func (session *Session) Close()
- func (session *Session) ConnectionTest() error
- func (session *Session) Open() error
- func (session *Session) SearchGroupByDN(groupDN string) ([]models.LdapGroup, error)
- func (session *Session) SearchGroupByName(groupName string) ([]models.LdapGroup, error)
- func (session *Session) SearchLdap(filter string) (*goldap.SearchResult, error)
- func (session *Session) SearchLdapAttribute(baseDN, filter string, attributes []string) (*goldap.SearchResult, error)
- func (session *Session) SearchUser(username string) ([]models.LdapUser, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrDNSyntax = errors.New("Invalid DN syntax")
ErrDNSyntax ...
View Source
var ErrNotFound = errors.New("entity not found")
ErrNotFound ...
Functions ¶
func ConnectionTestWithAllConfig ¶ added in v1.6.0
func ConnectionTestWithAllConfig(ldapConfig models.LdapConf, ldapGroupConfig models.LdapGroupConf) error
ConnectionTestWithAllConfig - test ldap session connection, out of the scope of normal session create/close
func ConnectionTestWithConfig ¶
ConnectionTestWithConfig -
Types ¶
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
Session - define a LDAP session
func CreateWithAllConfig ¶ added in v1.6.0
func CreateWithAllConfig(ldapConf models.LdapConf, ldapGroupConfig models.LdapGroupConf) (*Session, error)
CreateWithAllConfig - create a Session with internal config
func CreateWithConfig ¶
CreateWithConfig -
func LoadSystemLdapConfig ¶
LoadSystemLdapConfig - load LDAP configure
func (*Session) ConnectionTest ¶
ConnectionTest - test ldap session connection with system default setting
func (*Session) SearchGroupByDN ¶ added in v1.5.0
SearchGroupByDN ...
func (*Session) SearchGroupByName ¶ added in v1.5.0
SearchGroupByName ...
func (*Session) SearchLdap ¶
func (session *Session) SearchLdap(filter string) (*goldap.SearchResult, error)
SearchLdap to search ldap with the provide filter
func (*Session) SearchLdapAttribute ¶ added in v1.5.0
func (session *Session) SearchLdapAttribute(baseDN, filter string, attributes []string) (*goldap.SearchResult, error)
SearchLdapAttribute - to search ldap with the provide filter, with specified attributes
Click to show internal directories.
Click to hide internal directories.