Documentation
¶
Index ¶
- func IsAccountNotExist(err error) bool
- func IsAuthFail(err error) bool
- func IsObjectNotExist(err error) bool
- func IsRequestFail(err error) bool
- type Client
- func (this *Client) Check(dn ...string) error
- func (this *Client) Close()
- func (this *Client) FindSingleLevel(baseDN string, filter ...string) ([]*ldap.Entry, error)
- func (this *Client) FindSubtree(baseDN string, filter ...string) ([]*ldap.Entry, error)
- func (this *Client) Get(baseDN string, filter ...string) (*ldap.Entry, error)
- func (this *Client) GetSingleLevelOrganization(baseDN string) (map[string]*OrgUnit, map[string]*User, error)
- func (this *Client) GetSubTreeOrganization(baseDN string) (map[string]*OrgUnit, map[string]*User, error)
- func (this *Client) UserAuth(account, password string) (*User, error)
- type Config
- type DefaultEntryParser
- type ErrType
- type Error
- type IEntryParser
- type OrgUnit
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsAccountNotExist ¶
func IsAuthFail ¶
func IsObjectNotExist ¶
func IsRequestFail ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) FindSingleLevel ¶
func (*Client) FindSubtree ¶
func (*Client) GetSingleLevelOrganization ¶
func (*Client) GetSubTreeOrganization ¶
type Config ¶
type Config struct { Host string `json:"host,omitempty"` Port int `json:"port,omitempty"` Username string `json:"username,omitempty"` Password string `json:"password,omitempty"` BaseDN string `json:"base_dn,omitempty"` Timeout int `json:"timeout,omitempty"` // 连接超时,单位:秒 EnableTLS bool `json:"enable_tls,omitempty"` EntryParser IEntryParser `json:"-"` }
type DefaultEntryParser ¶
type DefaultEntryParser struct{}
func (DefaultEntryParser) EntrySearchFilter ¶
func (e DefaultEntryParser) EntrySearchFilter() string
func (DefaultEntryParser) ToOrgUnit ¶
func (e DefaultEntryParser) ToOrgUnit(entry *ldap.Entry, parentOrgUnit string) *OrgUnit
type IEntryParser ¶
type OrgUnit ¶
type OrgUnit struct { UID string `json:"uid,omitempty"` // 唯一标识 DN string `json:"dn,omitempty"` // 组织单元DN ParentOrgUnit string `json:"parent_org_unit,omitempty"` // 父级组织单元的UID Name string `json:"name,omitempty"` // 组织单元名称 Manager string `json:"manager,omitempty"` // 组织单元主管DN,由调用方自行转换成对应的人员UID }
OrgUnit 组织单元
type User ¶
type User struct { UID string `json:"uid,omitempty"` // 唯一标识 DN string `json:"dn,omitempty"` // 人员DN OrgUnit string `json:"org_unit,omitempty"` // 所属组织单元的UID Account string `json:"account,omitempty"` // 账户 Name string `json:"name,omitempty"` // 姓名 Mobile string `json:"mobile,omitempty"` // 手机号码 Telephone string `json:"telephone,omitempty"` // 电话号码 Email string `json:"email,omitempty"` // 邮箱 }
User 组织人员
Source Files
¶
Click to show internal directories.
Click to hide internal directories.