Skip to content
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

serve multiple APIs on single socket #36

Open
rade opened this issue Feb 19, 2016 · 2 comments · May be fixed by #70
Open

serve multiple APIs on single socket #36

rade opened this issue Feb 19, 2016 · 2 comments · May be fixed by #70

Comments

@rade
Copy link

rade commented Feb 19, 2016

It is useful to be able to serve multiple APIs, e.g. network and ipam, on a single socket. This is something that is anticipated in the plugin architecture / protocol - hence the "Implements" list in the handshake.

Currently this is impossible.

Weave uses that approach, and lack of support for this mode of operation is preventing it from adopting this library.

@calavera
Copy link
Contributor

@rade that sounds like a good idea. Please, feel free to open a pull request with a possible implementation and we'll be very happy to make it happen.

@rade
Copy link
Author

rade commented Feb 19, 2016

I spent some time looking at this and it appears to require a fair bit of surgery. Especially if this functionality is meant to be an incremental addition, e.g. enable s.t. like

import "github.com/docker/go-plugins-helpers/network"
import "github.com/docker/go-plugins-helpers/ipam"
import "github.com/docker/go-plugins-helpers/sdk"

dn := MyNetworkDriver{}
hn := network.NewHandler(d)

di := MyIPAMDriver{}
hi := ipam.NewHandler(d)

h := sdk.NewCompositeHandler(hn, hi)
h.ServeTCP("my_plugin", ":8080")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants