Documentation ¶
Index ¶
- Constants
- type IConnection
- type ILdapClient
- type LdapClient
- type Mock
- type MockConnection
- func (m *MockConnection) Bind(_, _ string) error
- func (m *MockConnection) Close()
- func (m *MockConnection) Search(_ *ldap.SearchRequest) (*ldap.SearchResult, error)
- func (m *MockConnection) SetTimeout(_ time.Duration)
- func (m *MockConnection) Start()
- func (m *MockConnection) StartTLS(_ *tls.Config) error
Constants ¶
View Source
const (
DefaultPortLDAP = 389
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IConnection ¶
type ILdapClient ¶
type ILdapClient interface { Connect() error Close() Authenticate(username, password string) (bool, map[string]string, error) GetUserGroups(userDN string) ([]string, error) IsAvailable() bool }
func NewLdapClient ¶
func NewLdapClient() ILdapClient
type LdapClient ¶
type LdapClient struct { Host string Port int Base string BindDN string BindPassword string ServerName string InsecureSkipVerify bool UseSSL bool SkipTLS bool ClientCertificates []tls.Certificate Conn IConnection UserFilter string }
func (*LdapClient) Authenticate ¶
func (*LdapClient) Close ¶
func (l *LdapClient) Close()
func (*LdapClient) Connect ¶
func (l *LdapClient) Connect() error
func (*LdapClient) GetUserGroups ¶
func (l *LdapClient) GetUserGroups(userDN string) ([]string, error)
func (*LdapClient) IsAvailable ¶
func (l *LdapClient) IsAvailable() bool
type MockConnection ¶
func (*MockConnection) Bind ¶
func (m *MockConnection) Bind(_, _ string) error
func (*MockConnection) Close ¶
func (m *MockConnection) Close()
func (*MockConnection) Search ¶
func (m *MockConnection) Search(_ *ldap.SearchRequest) (*ldap.SearchResult, error)
func (*MockConnection) SetTimeout ¶
func (m *MockConnection) SetTimeout(_ time.Duration)
func (*MockConnection) Start ¶
func (m *MockConnection) Start()
Click to show internal directories.
Click to hide internal directories.