{"modulePath":"github.com/stackdocker/gogs","version":"v0.7.22","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package ldap\n\n## Constants\n\n```go\nconst (\n\tMessageQuit     = 0\n\tMessageRequest  = 1\n\tMessageResponse = 2\n\tMessageFinish   = 3\n)\n```\n\n```go\nconst (\n\tFilterAnd             = 0\n\tFilterOr              = 1\n\tFilterNot             = 2\n\tFilterEqualityMatch   = 3\n\tFilterSubstrings      = 4\n\tFilterGreaterOrEqual  = 5\n\tFilterLessOrEqual     = 6\n\tFilterPresent         = 7\n\tFilterApproxMatch     = 8\n\tFilterExtensibleMatch = 9\n)\n```\n\n```go\nconst (\n\tFilterSubstringsInitial = 0\n\tFilterSubstringsAny     = 1\n\tFilterSubstringsFinal   = 2\n)\n```\n\n```go\nconst (\n\tApplicationBindRequest           = 0\n\tApplicationBindResponse          = 1\n\tApplicationUnbindRequest         = 2\n\tApplicationSearchRequest         = 3\n\tApplicationSearchResultEntry     = 4\n\tApplicationSearchResultDone      = 5\n\tApplicationModifyRequest         = 6\n\tApplicationModifyResponse        = 7\n\tApplicationAddRequest            = 8\n\tApplicationAddResponse           = 9\n\tApplicationDelRequest            = 10\n\tApplicationDelResponse           = 11\n\tApplicationModifyDNRequest       = 12\n\tApplicationModifyDNResponse      = 13\n\tApplicationCompareRequest        = 14\n\tApplicationCompareResponse       = 15\n\tApplicationAbandonRequest        = 16\n\tApplicationSearchResultReference = 19\n\tApplicationExtendedRequest       = 23\n\tApplicationExtendedResponse      = 24\n)\n```\nLDAP Application Codes\n\n```go\nconst (\n\tLDAPResultSuccess                      = 0\n\tLDAPResultOperationsError              = 1\n\tLDAPResultProtocolError                = 2\n\tLDAPResultTimeLimitExceeded            = 3\n\tLDAPResultSizeLimitExceeded            = 4\n\tLDAPResultCompareFalse                 = 5\n\tLDAPResultCompareTrue                  = 6\n\tLDAPResultAuthMethodNotSupported       = 7\n\tLDAPResultStrongAuthRequired           = 8\n\tLDAPResultReferral                     = 10\n\tLDAPResultAdminLimitExceeded           = 11\n\tLDAPResultUnavailableCriticalExtension = 12\n\tLDAPResultConfidentialityRequired      = 13\n\tLDAPResultSaslBindInProgress           = 14\n\tLDAPResultNoSuchAttribute              = 16\n\tLDAPResultUndefinedAttributeType       = 17\n\tLDAPResultInappropriateMatching        = 18\n\tLDAPResultConstraintViolation          = 19\n\tLDAPResultAttributeOrValueExists       = 20\n\tLDAPResultInvalidAttributeSyntax       = 21\n\tLDAPResultNoSuchObject                 = 32\n\tLDAPResultAliasProblem                 = 33\n\tLDAPResultInvalidDNSyntax              = 34\n\tLDAPResultAliasDereferencingProblem    = 36\n\tLDAPResultInappropriateAuthentication  = 48\n\tLDAPResultInvalidCredentials           = 49\n\tLDAPResultInsufficientAccessRights     = 50\n\tLDAPResultBusy                         = 51\n\tLDAPResultUnavailable                  = 52\n\tLDAPResultUnwillingToPerform           = 53\n\tLDAPResultLoopDetect                   = 54\n\tLDAPResultNamingViolation              = 64\n\tLDAPResultObjectClassViolation         = 65\n\tLDAPResultNotAllowedOnNonLeaf          = 66\n\tLDAPResultNotAllowedOnRDN              = 67\n\tLDAPResultEntryAlreadyExists           = 68\n\tLDAPResultObjectClassModsProhibited    = 69\n\tLDAPResultAffectsMultipleDSAs          = 71\n\tLDAPResultOther                        = 80\n\n\tErrorNetwork         = 200\n\tErrorFilterCompile   = 201\n\tErrorFilterDecompile = 202\n\tErrorDebugging       = 203\n)\n```\nLDAP Result Codes\n\n```go\nconst (\n\tAddAttribute     = 0\n\tDeleteAttribute  = 1\n\tReplaceAttribute = 2\n)\n```\n\n```go\nconst (\n\tScopeBaseObject   = 0\n\tScopeSingleLevel  = 1\n\tScopeWholeSubtree = 2\n)\n```\n\n```go\nconst (\n\tNeverDerefAliases   = 0\n\tDerefInSearching    = 1\n\tDerefFindingBaseObj = 2\n\tDerefAlways         = 3\n)\n```\n\n```go\nconst (\n\tControlTypePaging = \"1.2.840.113556.1.4.319\"\n)\n```\n\n## Variables\n\n```go\nvar ApplicationMap = map[uint8]string{\n\tApplicationBindRequest:           \"Bind Request\",\n\tApplicationBindResponse:          \"Bind Response\",\n\tApplicationUnbindRequest:         \"Unbind Request\",\n\tApplicationSearchRequest:         \"Search Request\",\n\tApplicationSearchResultEntry:     \"Search Result Entry\",\n\tApplicationSearchResultDone:      \"Search Result Done\",\n\tApplicationModifyRequest:         \"Modify Request\",\n\tApplicationModifyResponse:        \"Modify Response\",\n\tApplicationAddRequest:            \"Add Request\",\n\tApplicationAddResponse:           \"Add Response\",\n\tApplicationDelRequest:            \"Del Request\",\n\tApplicationDelResponse:           \"Del Response\",\n\tApplicationModifyDNRequest:       \"Modify DN Request\",\n\tApplicationModifyDNResponse:      \"Modify DN Response\",\n\tApplicationCompareRequest:        \"Compare Request\",\n\tApplicationCompareResponse:       \"Compare Response\",\n\tApplicationAbandonRequest:        \"Abandon Request\",\n\tApplicationSearchResultReference: \"Search Result Reference\",\n\tApplicationExtendedRequest:       \"Extended Request\",\n\tApplicationExtendedResponse:      \"Extended Response\",\n}\n```\n\n```go\nvar ControlTypeMap = map[string]string{\n\tControlTypePaging: \"Paging\",\n}\n```\n\n```go\nvar DerefMap = map[int]string{\n\tNeverDerefAliases:   \"NeverDerefAliases\",\n\tDerefInSearching:    \"DerefInSearching\",\n\tDerefFindingBaseObj: \"DerefFindingBaseObj\",\n\tDerefAlways:         \"DerefAlways\",\n}\n```\n\n```go\nvar FilterMap = map[uint64]string{\n\tFilterAnd:             \"And\",\n\tFilterOr:              \"Or\",\n\tFilterNot:             \"Not\",\n\tFilterEqualityMatch:   \"Equality Match\",\n\tFilterSubstrings:      \"Substrings\",\n\tFilterGreaterOrEqual:  \"Greater Or Equal\",\n\tFilterLessOrEqual:     \"Less Or Equal\",\n\tFilterPresent:         \"Present\",\n\tFilterApproxMatch:     \"Approx Match\",\n\tFilterExtensibleMatch: \"Extensible Match\",\n}\n```\n\n```go\nvar FilterSubstringsMap = map[uint64]string{\n\tFilterSubstringsInitial: \"Substrings Initial\",\n\tFilterSubstringsAny:     \"Substrings Any\",\n\tFilterSubstringsFinal:   \"Substrings Final\",\n}\n```\n\n```go\nvar LDAPResultCodeMap = map[uint8]string{\n\tLDAPResultSuccess:                      \"Success\",\n\tLDAPResultOperationsError:              \"Operations Error\",\n\tLDAPResultProtocolError:                \"Protocol Error\",\n\tLDAPResultTimeLimitExceeded:            \"Time Limit Exceeded\",\n\tLDAPResultSizeLimitExceeded:            \"Size Limit Exceeded\",\n\tLDAPResultCompareFalse:                 \"Compare False\",\n\tLDAPResultCompareTrue:                  \"Compare True\",\n\tLDAPResultAuthMethodNotSupported:       \"Auth Method Not Supported\",\n\tLDAPResultStrongAuthRequired:           \"Strong Auth Required\",\n\tLDAPResultReferral:                     \"Referral\",\n\tLDAPResultAdminLimitExceeded:           \"Admin Limit Exceeded\",\n\tLDAPResultUnavailableCriticalExtension: \"Unavailable Critical Extension\",\n\tLDAPResultConfidentialityRequired:      \"Confidentiality Required\",\n\tLDAPResultSaslBindInProgress:           \"Sasl Bind In Progress\",\n\tLDAPResultNoSuchAttribute:              \"No Such Attribute\",\n\tLDAPResultUndefinedAttributeType:       \"Undefined Attribute Type\",\n\tLDAPResultInappropriateMatching:        \"Inappropriate Matching\",\n\tLDAPResultConstraintViolation:          \"Constraint Violation\",\n\tLDAPResultAttributeOrValueExists:       \"Attribute Or Value Exists\",\n\tLDAPResultInvalidAttributeSyntax:       \"Invalid Attribute Syntax\",\n\tLDAPResultNoSuchObject:                 \"No Such Object\",\n\tLDAPResultAliasProblem:                 \"Alias Problem\",\n\tLDAPResultInvalidDNSyntax:              \"Invalid DN Syntax\",\n\tLDAPResultAliasDereferencingProblem:    \"Alias Dereferencing Problem\",\n\tLDAPResultInappropriateAuthentication:  \"Inappropriate Authentication\",\n\tLDAPResultInvalidCredentials:           \"Invalid Credentials\",\n\tLDAPResultInsufficientAccessRights:     \"Insufficient Access Rights\",\n\tLDAPResultBusy:                         \"Busy\",\n\tLDAPResultUnavailable:                  \"Unavailable\",\n\tLDAPResultUnwillingToPerform:           \"Unwilling To Perform\",\n\tLDAPResultLoopDetect:                   \"Loop Detect\",\n\tLDAPResultNamingViolation:              \"Naming Violation\",\n\tLDAPResultObjectClassViolation:         \"Object Class Violation\",\n\tLDAPResultNotAllowedOnNonLeaf:          \"Not Allowed On Non Leaf\",\n\tLDAPResultNotAllowedOnRDN:              \"Not Allowed On RDN\",\n\tLDAPResultEntryAlreadyExists:           \"Entry Already Exists\",\n\tLDAPResultObjectClassModsProhibited:    \"Object Class Mods Prohibited\",\n\tLDAPResultAffectsMultipleDSAs:          \"Affects Multiple DSAs\",\n\tLDAPResultOther:                        \"Other\",\n}\n```\n\n```go\nvar ScopeMap = map[int]string{\n\tScopeBaseObject:   \"Base Object\",\n\tScopeSingleLevel:  \"Single Level\",\n\tScopeWholeSubtree: \"Whole Subtree\",\n}\n```\n\n## Functions\n\n```go\nfunc CompileFilter(filter string) (*ber.Packet, error)\n```\n\n```go\nfunc DebugBinaryFile(fileName string) error\n```\n\n```go\nfunc DecompileFilter(packet *ber.Packet) (ret string, err error)\n```\n\n```go\nfunc NewError(resultCode uint8, err error) error\n```\n\n## Types\n\n```go\ntype Conn struct {\n\tDebug debugging\n\t// contains filtered or unexported fields\n}\n```\nConn represents an LDAP Connection\n\n```go\nfunc Dial(network, addr string) (*Conn, error)\n```\nDial connects to the given address on the given network using net.Dial and then returns a new Conn for the connection.\n\n```go\nfunc DialTLS(network, addr string, config *tls.Config) (*Conn, error)\n```\nDialTLS connects to the given address on the given network using tls.Dial and then returns a new Conn for the connection.\n\n```go\nfunc NewConn(conn net.Conn) *Conn\n```\nNewConn returns a new Conn using conn for network I/O.\n\n```go\nfunc (l *Conn) Bind(username, password string) error\n```\n\n```go\nfunc (l *Conn) Close()\n```\nClose closes the connection.\n\n```go\nfunc (l *Conn) Modify(modifyRequest *ModifyRequest) error\n```\n\n```go\nfunc (l *Conn) Search(searchRequest *SearchRequest) (*SearchResult, error)\n```\n\n```go\nfunc (l *Conn) SearchWithPaging(searchRequest *SearchRequest, pagingSize uint32) (*SearchResult, error)\n```\n\n```go\nfunc (l *Conn) StartTLS(config *tls.Config) error\n```\nStartTLS sends the command to start a TLS session and then creates a new TLS Client\n\n```go\ntype Control interface {\n\tGetControlType() string\n\tEncode() *ber.Packet\n\tString() string\n}\n```\n\n```go\nfunc DecodeControl(packet *ber.Packet) Control\n```\n\n```go\nfunc FindControl(controls []Control, controlType string) Control\n```\n\n```go\ntype ControlPaging struct {\n\tPagingSize uint32\n\tCookie     []byte\n}\n```\n\n```go\nfunc NewControlPaging(pagingSize uint32) *ControlPaging\n```\n\n```go\nfunc (c *ControlPaging) Encode() *ber.Packet\n```\n\n```go\nfunc (c *ControlPaging) GetControlType() string\n```\n\n```go\nfunc (c *ControlPaging) SetCookie(cookie []byte)\n```\n\n```go\nfunc (c *ControlPaging) String() string\n```\n\n```go\ntype ControlString struct {\n\tControlType  string\n\tCriticality  bool\n\tControlValue string\n}\n```\n\n```go\nfunc NewControlString(controlType string, criticality bool, controlValue string) *ControlString\n```\n\n```go\nfunc (c *ControlString) Encode() *ber.Packet\n```\n\n```go\nfunc (c *ControlString) GetControlType() string\n```\n\n```go\nfunc (c *ControlString) String() string\n```\n\n```go\ntype Entry struct {\n\tDN         string\n\tAttributes []*EntryAttribute\n}\n```\n\n```go\nfunc (e *Entry) GetAttributeValue(attribute string) string\n```\n\n```go\nfunc (e *Entry) GetAttributeValues(attribute string) []string\n```\n\n```go\nfunc (e *Entry) PrettyPrint(indent int)\n```\n\n```go\nfunc (e *Entry) Print()\n```\n\n```go\ntype EntryAttribute struct {\n\tName   string\n\tValues []string\n}\n```\n\n```go\nfunc (e *EntryAttribute) PrettyPrint(indent int)\n```\n\n```go\nfunc (e *EntryAttribute) Print()\n```\n\n```go\ntype Error struct {\n\tErr        error\n\tResultCode uint8\n}\n```\n\n```go\nfunc (e *Error) Error() string\n```\n\n```go\ntype ModifyRequest struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewModifyRequest(\n\tdn string,\n) *ModifyRequest\n```\n\n```go\nfunc (m *ModifyRequest) Add(attrType string, attrVals []string)\n```\n\n```go\nfunc (m *ModifyRequest) Delete(attrType string, attrVals []string)\n```\n\n```go\nfunc (m *ModifyRequest) Replace(attrType string, attrVals []string)\n```\n\n```go\ntype PartialAttribute struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\ntype SearchRequest struct {\n\tBaseDN       string\n\tScope        int\n\tDerefAliases int\n\tSizeLimit    int\n\tTimeLimit    int\n\tTypesOnly    bool\n\tFilter       string\n\tAttributes   []string\n\tControls     []Control\n}\n```\n\n```go\nfunc NewSearchRequest(\n\tBaseDN string,\n\tScope, DerefAliases, SizeLimit, TimeLimit int,\n\tTypesOnly bool,\n\tFilter string,\n\tAttributes []string,\n\tControls []Control,\n) *SearchRequest\n```\n\n```go\ntype SearchResult struct {\n\tEntries   []*Entry\n\tReferrals []string\n\tControls  []Control\n}\n```\n\n```go\nfunc (s *SearchResult) PrettyPrint(indent int)\n```\n\n```go\nfunc (s *SearchResult) Print()\n```\n\n","path":"github.com/stackdocker/gogs/modules/ldap","name":"ldap","synopsis":"","isRedistributable":true}
