-
Notifications
You must be signed in to change notification settings - Fork 205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Libkv should allow to independently vendor store backends #49
Comments
I'm even disagree with adding dependent code you need. All you need is a simple |
What about using new golang vendoring with something like https://github.com/Masterminds/glide and ignore de vendor folder? |
+1 to the concept. the value of libkv is not the number of backends that the project supports. Rather its the consistent API that the application can make use of without having to hardcode the backend. Alternative way to handle this is to provide a registration mechanism in libkv.go and let the drivers register itself with libkv. That will reverse the dependency and will force the users of libkv to |
@chenchun Agreed but this would be great for users of the lib to only import the necessary backends and thus vendor only the relevant parts without even touching to The problem as of now is that @mavenugo I really like the idea, sounds like the best compromise between the vendoring problem and ease of use :) |
Thanks @abronan. |
libkv changed how it registers backends recently. Instead of implicitly registering all backends in the libkv/store package itself, it now requires users to register their backends before actually using them. Ref: docker/libkv#49 docker/libkv#51
We recently added the
boltdb
backend and now we have to vendor 10K additional LoC regardless of the fact that we useboltDB
or not (in swarm for example).Ultimately we should vendor only the stores that are relevant to someone's usage (vendoring
consul
/etcd
/zookeeper
together makes sense as it is the case to vendorboltdb
/leveldb
/rocksdb
together potentially, etc.)The only solution I see for now is to remove the
libkv.go
entrypoint and let the user import and handle the logic of instantiating the Store. The experience is not seamless but I prefer this to the solution of vendoring 10K LoC that we don't use 😕The text was updated successfully, but these errors were encountered: