jmckaskill / goldap Goto Github PK
View Code? Open in Web Editor NEWGo bindings to LDAP
Go bindings to LDAP
If would be useful, if you could provide a simple example app for goldap.
Thank you
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.
Looks like there is an encoding issue when using the AND or OR filters for LDAP filtering. Any experience with this yourself?
I want to use Sourcegraph for goldap code search, browsing, and usage examples. Can an admin enable Sourcegraph for this repository? Just go to https://sourcegraph.com/github.com/jmckaskill/goldap. (It should only take 30 seconds.)
Thank you!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.