Versions in this module Expand all Collapse all v0 v0.0.2 Feb 26, 2026 v0.0.1 Feb 26, 2026 Changes in this version + const ApplicationAbandonRequest + const ApplicationAddRequest + const ApplicationAddResponse + const ApplicationBindRequest + const ApplicationBindResponse + const ApplicationCompareRequest + const ApplicationCompareResponse + const ApplicationDelRequest + const ApplicationDelResponse + const ApplicationExtendedRequest + const ApplicationExtendedResponse + const ApplicationModifyDNRequest + const ApplicationModifyDNResponse + const ApplicationModifyRequest + const ApplicationModifyResponse + const ApplicationSearchRequest + const ApplicationSearchResultDone + const ApplicationSearchResultEntry + const ApplicationSearchResultReference + const ApplicationUnbindRequest + const BeheraAccountLocked + const BeheraChangeAfterReset + const BeheraInsufficientPasswordQuality + const BeheraMustSupplyOldPassword + const BeheraPasswordExpired + const BeheraPasswordInHistory + const BeheraPasswordModNotAllowed + const BeheraPasswordTooShort + const BeheraPasswordTooYoung + const ControlTypeBeheraPasswordPolicy + const ControlTypeManageDsaIT + const ControlTypeMicrosoftNotification + const ControlTypeMicrosoftServerLinkTTL + const ControlTypeMicrosoftShowDeleted + const ControlTypePaging + const ControlTypeSubtreeDelete + const ControlTypeVChuPasswordMustChange + const ControlTypeVChuPasswordWarning + const ControlTypeWhoAmI + const DefaultLdapPort + const DefaultLdapsPort + const ErrorDebugging + const ErrorEmptyPassword + const ErrorFilterCompile + const ErrorFilterDecompile + const ErrorNetwork + const ErrorUnexpectedMessage + const ErrorUnexpectedResponse + const LDAPResultAdminLimitExceeded + const LDAPResultAffectsMultipleDSAs + const LDAPResultAliasDereferencingProblem + const LDAPResultAliasProblem + const LDAPResultAmbiguousResponse + const LDAPResultAssertionFailed + const LDAPResultAttributeOrValueExists + const LDAPResultAuthMethodNotSupported + const LDAPResultAuthUnknown + const LDAPResultAuthorizationDenied + const LDAPResultBusy + const LDAPResultCanceled + const LDAPResultCannotCancel + const LDAPResultClientLoop + const LDAPResultCompareFalse + const LDAPResultCompareTrue + const LDAPResultConfidentialityRequired + const LDAPResultConnectError + const LDAPResultConstraintViolation + const LDAPResultControlNotFound + const LDAPResultDecodingError + const LDAPResultEncodingError + const LDAPResultEntryAlreadyExists + const LDAPResultFilterError + const LDAPResultInappropriateAuthentication + const LDAPResultInappropriateMatching + const LDAPResultInsufficientAccessRights + const LDAPResultIntermediateResponse + const LDAPResultInvalidAttributeSyntax + const LDAPResultInvalidCredentials + const LDAPResultInvalidDNSyntax + const LDAPResultInvalidResponse + const LDAPResultIsLeaf + const LDAPResultLocalError + const LDAPResultLoopDetect + const LDAPResultMoreResultsToReturn + const LDAPResultNamingViolation + const LDAPResultNoMemory + const LDAPResultNoResultsReturned + const LDAPResultNoSuchAttribute + const LDAPResultNoSuchObject + const LDAPResultNoSuchOperation + const LDAPResultNotAllowedOnNonLeaf + const LDAPResultNotAllowedOnRDN + const LDAPResultNotSupported + const LDAPResultObjectClassModsProhibited + const LDAPResultObjectClassViolation + const LDAPResultOffsetRangeError + const LDAPResultOperationsError + const LDAPResultOther + const LDAPResultParamError + const LDAPResultProtocolError + const LDAPResultReferral + const LDAPResultReferralLimitExceeded + const LDAPResultResultsTooLarge + const LDAPResultSaslBindInProgress + const LDAPResultServerDown + const LDAPResultSizeLimitExceeded + const LDAPResultSortControlMissing + const LDAPResultStrongAuthRequired + const LDAPResultSuccess + const LDAPResultSyncRefreshRequired + const LDAPResultTLSNotSupported + const LDAPResultTimeLimitExceeded + const LDAPResultTimeout + const LDAPResultTooLate + const LDAPResultUnavailable + const LDAPResultUnavailableCriticalExtension + const LDAPResultUndefinedAttributeType + const LDAPResultUnknownType + const LDAPResultUnwillingToPerform + const LDAPResultUserCanceled + const LDAPResultVirtualListViewErrorOrControlError + const MessageFinish + const MessageQuit + const MessageRequest + const MessageResponse + const MessageTimeout + var ApplicationMap = map[uint8]string + var BeheraPasswordPolicyErrorMap = map[int8]string + var ControlTypeMap = map[string]string + var DefaultTimeout = 60 * time.Second + var ErrConnUnbound = NewError(ErrorNetwork, errors.New("ldap: connection is closed")) + var ErrNilConnection = errors.New("ldap: conn is nil, expected net.Conn") + var LDAPResultCodeMap = map[uint16]string + func DebugBinaryFile(fileName string) error + func EscapeDN(dn string) string + func EscapeFilter(filter string) string + func GetLDAPError(packet *ber.Packet) error + func IsErrorAnyOf(err error, codes ...uint16) bool + func IsErrorWithCode(err error, desiredResultCode uint16) bool + func Logger(l *log.Logger) + func NewError(resultCode uint16, err error) error + type AttributeTypeAndValue struct + Type string + Value string + func (a *AttributeTypeAndValue) Equal(other *AttributeTypeAndValue) bool + func (a *AttributeTypeAndValue) EqualFold(other *AttributeTypeAndValue) bool + func (a *AttributeTypeAndValue) String() string + type Client interface + Bind func(username, password string) error + BindContext func(ctx context.Context, username, password string) error + Close func() + IsClosing func() bool + SetTimeout func(time.Duration) + SimpleBind func(*SimpleBindRequest) (*SimpleBindResult, error) + SimpleBindContext func(ctx context.Context, req *SimpleBindRequest) (*SimpleBindResult, error) + Start func() + StartTLS func(*tls.Config) error + TLSConnectionState func() (tls.ConnectionState, bool) + Unbind func() error + type Conn struct + Debug debugging + func Dial(network, addr string) (*Conn, error) + func DialTLS(network, addr string, config *tls.Config) (*Conn, error) + func DialURL(addr string, opts ...DialOpt) (*Conn, error) + func NewConn(conn net.Conn, isTLS bool) *Conn + func (l *Conn) Bind(username, password string) error + func (l *Conn) BindContext(ctx context.Context, username, password string) error + func (l *Conn) Close() + func (l *Conn) DigestMD5Bind(digestMD5BindRequest *DigestMD5BindRequest) (*DigestMD5BindResult, error) + func (l *Conn) ExternalBind() error + func (l *Conn) GSSAPIBind(client GSSAPIClient, servicePrincipal, authzid string) error + func (l *Conn) GSSAPIBindRequest(client GSSAPIClient, req *GSSAPIBindRequest) error + func (l *Conn) IsClosing() bool + func (l *Conn) MD5Bind(host, username, password string) error + func (l *Conn) NTLMBind(domain, username, password string) error + func (l *Conn) NTLMBindWithHash(domain, username, hash string) error + func (l *Conn) NTLMChallengeBind(ntlmBindRequest *NTLMBindRequest) (*NTLMBindResult, error) + func (l *Conn) NTLMUnauthenticatedBind(domain, username string) error + func (l *Conn) SetTimeout(timeout time.Duration) + func (l *Conn) SimpleBind(simpleBindRequest *SimpleBindRequest) (*SimpleBindResult, error) + func (l *Conn) SimpleBindContext(ctx context.Context, simpleBindRequest *SimpleBindRequest) (*SimpleBindResult, error) + func (l *Conn) Start() + func (l *Conn) StartContext(ctx context.Context) + func (l *Conn) StartTLS(config *tls.Config) error + func (l *Conn) TLSConnectionState() (state tls.ConnectionState, ok bool) + func (l *Conn) UnauthenticatedBind(username string) error + func (l *Conn) Unbind() error + func (l *Conn) WhoAmI(controls []Control) (*WhoAmIResult, error) + type Control interface + Encode func() *ber.Packet + GetControlType func() string + String func() string + func DecodeControl(packet *ber.Packet) (Control, error) + func FindControl(controls []Control, controlType string) Control + type ControlBeheraPasswordPolicy struct + Error int8 + ErrorString string + Expire int64 + Grace int64 + func NewControlBeheraPasswordPolicy() *ControlBeheraPasswordPolicy + func (c *ControlBeheraPasswordPolicy) Encode() *ber.Packet + func (c *ControlBeheraPasswordPolicy) GetControlType() string + func (c *ControlBeheraPasswordPolicy) String() string + type ControlManageDsaIT struct + Criticality bool + func NewControlManageDsaIT(Criticality bool) *ControlManageDsaIT + func (c *ControlManageDsaIT) Encode() *ber.Packet + func (c *ControlManageDsaIT) GetControlType() string + func (c *ControlManageDsaIT) String() string + type ControlMicrosoftNotification struct + func NewControlMicrosoftNotification() *ControlMicrosoftNotification + func (c *ControlMicrosoftNotification) Encode() *ber.Packet + func (c *ControlMicrosoftNotification) GetControlType() string + func (c *ControlMicrosoftNotification) String() string + type ControlMicrosoftServerLinkTTL struct + func NewControlMicrosoftServerLinkTTL() *ControlMicrosoftServerLinkTTL + func (c *ControlMicrosoftServerLinkTTL) Encode() *ber.Packet + func (c *ControlMicrosoftServerLinkTTL) GetControlType() string + func (c *ControlMicrosoftServerLinkTTL) String() string + type ControlMicrosoftShowDeleted struct + func NewControlMicrosoftShowDeleted() *ControlMicrosoftShowDeleted + func (c *ControlMicrosoftShowDeleted) Encode() *ber.Packet + func (c *ControlMicrosoftShowDeleted) GetControlType() string + func (c *ControlMicrosoftShowDeleted) String() string + type ControlPaging struct + Cookie []byte + PagingSize uint32 + func NewControlPaging(pagingSize uint32) *ControlPaging + func (c *ControlPaging) Encode() *ber.Packet + func (c *ControlPaging) GetControlType() string + func (c *ControlPaging) SetCookie(cookie []byte) + func (c *ControlPaging) String() string + type ControlString struct + ControlType string + ControlValue string + Criticality bool + func NewControlString(controlType string, criticality bool, controlValue string) *ControlString + func (c *ControlString) Encode() *ber.Packet + func (c *ControlString) GetControlType() string + func (c *ControlString) String() string + type ControlSubtreeDelete struct + func NewControlSubtreeDelete() *ControlSubtreeDelete + func (c *ControlSubtreeDelete) Encode() *ber.Packet + func (c *ControlSubtreeDelete) GetControlType() string + func (c *ControlSubtreeDelete) String() string + type ControlVChuPasswordMustChange struct + MustChange bool + func (c *ControlVChuPasswordMustChange) Encode() *ber.Packet + func (c *ControlVChuPasswordMustChange) GetControlType() string + func (c *ControlVChuPasswordMustChange) String() string + type ControlVChuPasswordWarning struct + Expire int64 + func (c *ControlVChuPasswordWarning) Encode() *ber.Packet + func (c *ControlVChuPasswordWarning) GetControlType() string + func (c *ControlVChuPasswordWarning) String() string + type DN struct + RDNs []*RelativeDN + func ParseDN(str string) (*DN, error) + func (d *DN) AncestorOf(other *DN) bool + func (d *DN) AncestorOfFold(other *DN) bool + func (d *DN) Equal(other *DN) bool + func (d *DN) EqualFold(other *DN) bool + func (d *DN) String() string + type DialContext struct + type DialOpt func(*DialContext) + func DialWithContext(ctx context.Context) DialOpt + func DialWithDialer(d *net.Dialer) DialOpt + func DialWithTLSConfig(tc *tls.Config) DialOpt + func DialWithTLSDialer(tlsConfig *tls.Config, dialer *net.Dialer) DialOpt + type DigestMD5BindRequest struct + Controls []Control + Host string + Password string + Username string + type DigestMD5BindResult struct + Controls []Control + type Error struct + Err error + MatchedDN string + Packet *ber.Packet + ResultCode uint16 + func (e *Error) Error() string + func (e *Error) Unwrap() error + type GSSAPIBindRequest struct + AuthZID string + Controls []Control + ServicePrincipalName string + type GSSAPIClient interface + DeleteSecContext func() error + InitSecContext func(target string, token []byte) (outputToken []byte, needContinue bool, err error) + NegotiateSaslAuth func(token []byte, authzid string) ([]byte, error) + type NTLMBindRequest struct + AllowEmptyPassword bool + Controls []Control + Domain string + Hash string + Password string + Username string + type NTLMBindResult struct + Controls []Control + type PacketResponse struct + Error error + Packet *ber.Packet + func (pr *PacketResponse) ReadPacket() (*ber.Packet, error) + type RelativeDN struct + Attributes []*AttributeTypeAndValue + func (r *RelativeDN) Equal(other *RelativeDN) bool + func (r *RelativeDN) EqualFold(other *RelativeDN) bool + func (r *RelativeDN) String() string + type SimpleBindRequest struct + AllowEmptyPassword bool + Controls []Control + Password string + Username string + func NewSimpleBindRequest(username string, password string, controls []Control) *SimpleBindRequest + type SimpleBindResult struct + Controls []Control + type WhoAmIResult struct + AuthzID string