Documentation ¶
Index ¶
- func BuildDBDriver(opts *Options) string
- func WithBaseDN[T IBaseDN](baseDN string) func(T)
- func WithControls[T IControls](controls []ldap.Control) func(T)
- type AddOption
- type AddOptions
- type BaseOption
- type BaseOptions
- type DBConnect
- func (db *DBConnect) DoAdd(ctx context.Context, opts ...AddOption) error
- func (db *DBConnect) DoDel(ctx context.Context, opts ...DelOption) error
- func (db *DBConnect) DoModify(ctx context.Context, opts ...ModifyOption) (*ldap.ModifyResult, error)
- func (db *DBConnect) DoModifyDN(ctx context.Context, opts ...ModifyDNOption) error
- func (db *DBConnect) DoPasswordModify(ctx context.Context, opts ...PasswordModifyOption) (*ldap.PasswordModifyResult, error)
- func (db *DBConnect) DoSearch(ctx context.Context, filter string, opts ...RequestOption) (results []*ldap.Entry, err error)
- func (db *DBConnect) WithAdd(attrType string, attrVals []string) ModifyOption
- func (db *DBConnect) WithAddAttributes(attrs []ldap.Attribute) AddOption
- func (db *DBConnect) WithAttribute(attrType string, attrVals []string) AddOption
- func (db *DBConnect) WithChanges(changes []ldap.Change) ModifyOption
- func (db *DBConnect) WithDelete(attrType string, attrVals []string) ModifyOption
- func (db *DBConnect) WithDeleteOldRDN(delOld bool) ModifyDNOption
- func (db *DBConnect) WithDerefAliases(derefAliases int) RequestOption
- func (db *DBConnect) WithFilter(filter string) RequestOption
- func (db *DBConnect) WithIncrement(attrType string, attrVals string) ModifyOption
- func (db *DBConnect) WithNewPassword(newPassword string) PasswordModifyOption
- func (db *DBConnect) WithNewRDN(rdn string) ModifyDNOption
- func (db *DBConnect) WithNewSuperior(newSup string) ModifyDNOption
- func (db *DBConnect) WithOldPassword(oldPassword string) PasswordModifyOption
- func (db *DBConnect) WithPageSize(pageSize uint32) RequestOption
- func (db *DBConnect) WithReplace(attrType string, attrVals []string) ModifyOption
- func (db *DBConnect) WithScope(scope int) RequestOption
- func (db *DBConnect) WithSearchAttributes(attributes []string) RequestOption
- func (db *DBConnect) WithSizeLimit(sizeLimit int) RequestOption
- func (db *DBConnect) WithTimeLimit(timeLimit int) RequestOption
- func (db *DBConnect) WithTypesOnly(typesOnly bool) RequestOption
- func (db *DBConnect) WithUserIdentity(userIdentity string) PasswordModifyOption
- type DelOption
- type DelOptions
- type IBaseDN
- type IControls
- type ModifyDNOption
- type ModifyDNOptions
- type ModifyOption
- type ModifyOptions
- type Option
- type Options
- type PasswordModifyOption
- type PasswordModifyOptions
- type RequestOption
- type RequestOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildDBDriver ¶
BuildDBDriver return a driver like "protocol://host:port"
func WithBaseDN ¶
func WithControls ¶
func WithControls[T IControls](controls []ldap.Control) func(T)
Types ¶
type AddOption ¶
type AddOption func(opts *AddOptions)
type AddOptions ¶
type AddOptions struct { *BaseOptions *ldap.AddRequest }
type BaseOption ¶
type BaseOption func(opt *BaseOptions)
type BaseOptions ¶
type BaseOptions struct { BaseDN string Controls []ldap.Control }
type DBConnect ¶
type DBConnect struct { *ldap.Conn Options *Options }
func (*DBConnect) DoAdd ¶
DoAdd 执行默认 ldap 查询
AddOptions: WithBaseDN[*RequestOptions] 默认为创建连接时的 DN,如果创建连接时未指定,则这里必须指定 WithControls[*RequestOptions] db.WithAttribute db.WithAddAttributes
func (*DBConnect) DoDel ¶
DoAdd 执行默认 ldap 查询
AddOptions: WithBaseDN[*RequestOptions] 默认为创建连接时的 DN,如果创建连接时未指定,则这里必须指定 WithControls[*RequestOptions]
func (*DBConnect) DoModify ¶
func (db *DBConnect) DoModify(ctx context.Context, opts ...ModifyOption) (*ldap.ModifyResult, error)
DoModify 执行默认 ldap 查询
ModifyOptions: WithBaseDN[*RequestOptions] 默认为创建连接时的 DN,如果创建连接时未指定,则这里必须指定 WithControls[*RequestOptions] db.WithAdd db.WithDelete db.WithReplace db.WithIncrement db.WithChanges
func (*DBConnect) DoModifyDN ¶
func (db *DBConnect) DoModifyDN(ctx context.Context, opts ...ModifyDNOption) error
DoModifyDN 执行默认 ldap 查询
ModifyDNOptions: WithBaseDN[*RequestOptions] 默认为创建连接时的 DN,如果创建连接时未指定,则这里必须指定 WithControls[*RequestOptions] db.WithNewRDN db.WithDeleteOldRDN db.WithNewSuperior
func (*DBConnect) DoPasswordModify ¶
func (db *DBConnect) DoPasswordModify(ctx context.Context, opts ...PasswordModifyOption) (*ldap.PasswordModifyResult, error)
DoPasswordModify 执行默认 ldap 查询
PasswordModifyOptions: db.WithUserIdentity 必须 db.WithOldPassword 必须 db.WithNewPassword 必须
func (*DBConnect) DoSearch ¶
func (db *DBConnect) DoSearch(ctx context.Context, filter string, opts ...RequestOption) (results []*ldap.Entry, err error)
DoSearch 执行默认 ldap 查询
ReuqestOptions: WithBaseDN[*RequestOptions] 默认为创建连接时的 DN,如果创建连接时未指定,则这里必须指定 WithControls[*RequestOptions] db.WithSearchAttributes 默认查询全部字段 db.WithScope db.WithDerefAliases db.WithSizeLimit db.WithTimeLimit db.WithTypesOnly db.WithPageSize
func (*DBConnect) WithAdd ¶
func (db *DBConnect) WithAdd(attrType string, attrVals []string) ModifyOption
func (*DBConnect) WithAddAttributes ¶
func (*DBConnect) WithAttribute ¶
func (*DBConnect) WithChanges ¶
func (db *DBConnect) WithChanges(changes []ldap.Change) ModifyOption
func (*DBConnect) WithDelete ¶
func (db *DBConnect) WithDelete(attrType string, attrVals []string) ModifyOption
func (*DBConnect) WithDeleteOldRDN ¶
func (db *DBConnect) WithDeleteOldRDN(delOld bool) ModifyDNOption
func (*DBConnect) WithDerefAliases ¶
func (db *DBConnect) WithDerefAliases(derefAliases int) RequestOption
func (*DBConnect) WithFilter ¶
func (db *DBConnect) WithFilter(filter string) RequestOption
func (*DBConnect) WithIncrement ¶
func (db *DBConnect) WithIncrement(attrType string, attrVals string) ModifyOption
func (*DBConnect) WithNewPassword ¶
func (db *DBConnect) WithNewPassword(newPassword string) PasswordModifyOption
func (*DBConnect) WithNewRDN ¶
func (db *DBConnect) WithNewRDN(rdn string) ModifyDNOption
func (*DBConnect) WithNewSuperior ¶
func (db *DBConnect) WithNewSuperior(newSup string) ModifyDNOption
func (*DBConnect) WithOldPassword ¶
func (db *DBConnect) WithOldPassword(oldPassword string) PasswordModifyOption
func (*DBConnect) WithPageSize ¶
func (db *DBConnect) WithPageSize(pageSize uint32) RequestOption
func (*DBConnect) WithReplace ¶
func (db *DBConnect) WithReplace(attrType string, attrVals []string) ModifyOption
func (*DBConnect) WithScope ¶
func (db *DBConnect) WithScope(scope int) RequestOption
func (*DBConnect) WithSearchAttributes ¶
func (db *DBConnect) WithSearchAttributes(attributes []string) RequestOption
func (*DBConnect) WithSizeLimit ¶
func (db *DBConnect) WithSizeLimit(sizeLimit int) RequestOption
func (*DBConnect) WithTimeLimit ¶
func (db *DBConnect) WithTimeLimit(timeLimit int) RequestOption
func (*DBConnect) WithTypesOnly ¶
func (db *DBConnect) WithTypesOnly(typesOnly bool) RequestOption
func (*DBConnect) WithUserIdentity ¶
func (db *DBConnect) WithUserIdentity(userIdentity string) PasswordModifyOption
type DelOption ¶
type DelOption func(*DelOptions)
type DelOptions ¶
type DelOptions struct { *BaseOptions *ldap.DelRequest }
type ModifyDNOption ¶
type ModifyDNOption func(opts *ModifyDNOptions)
type ModifyDNOptions ¶
type ModifyDNOptions struct { *BaseOptions *ldap.ModifyDNRequest }
type ModifyOption ¶
type ModifyOption func(opts *ModifyOptions)
type ModifyOptions ¶
type ModifyOptions struct { *BaseOptions *ldap.ModifyRequest }
type PasswordModifyOption ¶
type PasswordModifyOption func(opts *PasswordModifyOptions)
type PasswordModifyOptions ¶
type PasswordModifyOptions struct {
*ldap.PasswordModifyRequest
}
type RequestOption ¶
type RequestOption func(opts *RequestOptions)
type RequestOptions ¶
type RequestOptions struct { PageSize uint32 *BaseOptions *ldap.SearchRequest }
Click to show internal directories.
Click to hide internal directories.