ldap

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 9, 2023 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 3 more Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ScopeBaseObject   = 0
	ScopeSingleLevel  = 1
	ScopeWholeSubtree = 2
)

scope choices

View Source
const (
	NeverDerefAliases   = 0
	DerefInSearching    = 1
	DerefFindingBaseObj = 2
	DerefAlways         = 3
)

derefAliases

Variables

View Source
var DerefMap = map[int]string{
	NeverDerefAliases:   "NeverDerefAliases",
	DerefInSearching:    "DerefInSearching",
	DerefFindingBaseObj: "DerefFindingBaseObj",
	DerefAlways:         "DerefAlways",
}

DerefMap contains human readable descriptions of derefAliases choices

View Source
var ScopeMap = map[int]string{
	ScopeBaseObject:   "Base Object",
	ScopeSingleLevel:  "Single Level",
	ScopeWholeSubtree: "Whole Subtree",
}

ScopeMap contains human readable descriptions of scope choices

Functions

func AppendToMapIfNotEmpty

func AppendToMapIfNotEmpty(m map[string]interface{}, k string, v interface{})

func ConnectAndThen

func ConnectAndThen(ldapServer string, enableTls, md5 bool, username, password string, fun func(conn *ldap.Conn) error) error

func DoBindForLDAP

func DoBindForLDAP(ldapServer string, tls, md5 bool, username, password string) error

func GetOrNewFromPool

func GetOrNewFromPool(ldapServer string, enableTls, md5 bool, username, password string) (*ldap.Conn, error)

Types

type Ldap

type Ldap struct {
	// contains filtered or unexported fields
}

func NewLdapService

func NewLdapService() *Ldap

func (*Ldap) Configuration

func (srv *Ldap) Configuration(
	Server string,
	Tls *uint64,
	Md5 *uint64,
	BindDn string,
	Password string,
	BaseDn string,
	Filter string,
	AdminBaseDn string,
	AdminFilter string,
	EmailAttr string,
	UserNameAttr string,
	Enable *uint64) error

func (*Ldap) Get

func (srv *Ldap) Get() (*model.LdapModel, error)

func (*Ldap) MarkErrorOccur

func (srv *Ldap) MarkErrorOccur(id, syncGen uint64, errMsg string) bool

func (*Ldap) TryGetLock

func (srv *Ldap) TryGetLock(id uint64, newProtectedTs, nowProtectedTs int64) bool

func (*Ldap) TryUnLock

func (srv *Ldap) TryUnLock(id uint64, nowProtectedTs int64)

func (*Ldap) UpdateGen

func (srv *Ldap) UpdateGen(id, syncGen uint64, entries, inserts, updates, deletes, fails int, costs int64) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL