Giter VIP home page Giter VIP logo

goldap's People

Contributors

jmckaskill avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

goldap's Issues

Issues with AND and OR Filters

Looks like there is an encoding issue when using the AND or OR filters for LDAP filtering. Any experience with this yourself?

db.SearchTree() fails when given function for output (index out of range)

I created a little test program to run a simple query against my University's LDAP directory. I think I've figured out how to do most of what I want, but I ran into a problem with passing a function to db.SearchTree() to handle output.

In this gist: https://gist.github.com/3239180

I run the same query, giving SearchTree() a plain struct, a slice of structs, a channel, and a function. All of them work except the function, which panics with an index out of range:

panic: runtime error: index out of range

goroutine 1 [running]:
reflect.(*commonType).In(0x4eebd0, 0x1, 0x130, 0xf840063000, 0x4eebd0, ...)
        /usr/local/go/src/pkg/reflect/type.go:612 +0x84
github.com/jmckaskill/goldap.(*DB).search(0xf8400000e0, 0x4eebc0, 0x4016c7, 0x58dd64, 0x7f520000001b, ...)
        /home/anders/code/go/src/github.com/jmckaskill/goldap/search.go:288 +0x8a5
github.com/jmckaskill/goldap.(*DB).SearchTree(0xf8400000e0, 0x4eebc0, 0x4016c7, 0x58dd64, 0xf80000001b, ...)
        /home/anders/code/go/src/github.com/jmckaskill/goldap/search.go:334 +0x7d

Line 288 of search.go is:

typ = ft.In(1)

And is called right after a

if ft.NumIn() != 1 {
    panic("expected function with 1 argument")
}

So, it looks to me like it should be "typ = ft.In(0)" there instead. When I change that it works for me.

Of course, I'm pretty new to Go and had to reverse engineer the interface for making a query from your code since there's no real documentation. So it's entirely possible that I'm missing something obvious and did something really dumb.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.