diff options
author | Samuel Stauffer <samuel@descolada.com> | 2014-03-19 23:13:31 +0100 |
---|---|---|
committer | Samuel Stauffer <samuel@descolada.com> | 2014-03-19 23:13:31 +0100 |
commit | 5023af85baebfd0fb8b00d23be19a17f49e02028 (patch) | |
tree | a77d7b9b0b754842af325eb204b430722333de30 /search.go | |
parent | Don't capitalize function arguments (diff) | |
download | ldap-5023af85baebfd0fb8b00d23be19a17f49e02028.tar ldap-5023af85baebfd0fb8b00d23be19a17f49e02028.tar.gz ldap-5023af85baebfd0fb8b00d23be19a17f49e02028.tar.bz2 ldap-5023af85baebfd0fb8b00d23be19a17f49e02028.tar.lz ldap-5023af85baebfd0fb8b00d23be19a17f49e02028.tar.xz ldap-5023af85baebfd0fb8b00d23be19a17f49e02028.tar.zst ldap-5023af85baebfd0fb8b00d23be19a17f49e02028.zip |
Diffstat (limited to 'search.go')
-rw-r--r-- | search.go | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -174,12 +174,12 @@ type SearchRequest struct { func (s *SearchRequest) encode() (*ber.Packet, error) { request := ber.Encode(ber.ClassApplication, ber.TypeConstructed, ApplicationSearchRequest, nil, "Search Request") - request.AppendChild(ber.NewString(ber.ClassUniversal, ber.TypePrimative, ber.TagOctetString, s.BaseDN, "Base DN")) - request.AppendChild(ber.NewInteger(ber.ClassUniversal, ber.TypePrimative, ber.TagEnumerated, uint64(s.Scope), "Scope")) - request.AppendChild(ber.NewInteger(ber.ClassUniversal, ber.TypePrimative, ber.TagEnumerated, uint64(s.DerefAliases), "Deref Aliases")) - request.AppendChild(ber.NewInteger(ber.ClassUniversal, ber.TypePrimative, ber.TagInteger, uint64(s.SizeLimit), "Size Limit")) - request.AppendChild(ber.NewInteger(ber.ClassUniversal, ber.TypePrimative, ber.TagInteger, uint64(s.TimeLimit), "Time Limit")) - request.AppendChild(ber.NewBoolean(ber.ClassUniversal, ber.TypePrimative, ber.TagBoolean, s.TypesOnly, "Types Only")) + request.AppendChild(ber.NewString(ber.ClassUniversal, ber.TypePrimitive, ber.TagOctetString, s.BaseDN, "Base DN")) + request.AppendChild(ber.NewInteger(ber.ClassUniversal, ber.TypePrimitive, ber.TagEnumerated, uint64(s.Scope), "Scope")) + request.AppendChild(ber.NewInteger(ber.ClassUniversal, ber.TypePrimitive, ber.TagEnumerated, uint64(s.DerefAliases), "Deref Aliases")) + request.AppendChild(ber.NewInteger(ber.ClassUniversal, ber.TypePrimitive, ber.TagInteger, uint64(s.SizeLimit), "Size Limit")) + request.AppendChild(ber.NewInteger(ber.ClassUniversal, ber.TypePrimitive, ber.TagInteger, uint64(s.TimeLimit), "Time Limit")) + request.AppendChild(ber.NewBoolean(ber.ClassUniversal, ber.TypePrimitive, ber.TagBoolean, s.TypesOnly, "Types Only")) // compile and encode filter filterPacket, err := CompileFilter(s.Filter) if err != nil { @@ -189,7 +189,7 @@ func (s *SearchRequest) encode() (*ber.Packet, error) { // encode attributes attributesPacket := ber.Encode(ber.ClassUniversal, ber.TypeConstructed, ber.TagSequence, nil, "Attributes") for _, attribute := range s.Attributes { - attributesPacket.AppendChild(ber.NewString(ber.ClassUniversal, ber.TypePrimative, ber.TagOctetString, attribute, "Attribute")) + attributesPacket.AppendChild(ber.NewString(ber.ClassUniversal, ber.TypePrimitive, ber.TagOctetString, attribute, "Attribute")) } request.AppendChild(attributesPacket) return request, nil @@ -273,7 +273,7 @@ func (l *Conn) SearchWithPaging(searchRequest *SearchRequest, pagingSize uint32) func (l *Conn) Search(searchRequest *SearchRequest) (*SearchResult, error) { messageID := l.nextMessageID() packet := ber.Encode(ber.ClassUniversal, ber.TypeConstructed, ber.TagSequence, nil, "LDAP Request") - packet.AppendChild(ber.NewInteger(ber.ClassUniversal, ber.TypePrimative, ber.TagInteger, messageID, "MessageID")) + packet.AppendChild(ber.NewInteger(ber.ClassUniversal, ber.TypePrimitive, ber.TagInteger, messageID, "MessageID")) // encode search request encodedSearchRequest, err := searchRequest.encode() if err != nil { |