Expose the remote driver API structs publicly.#249
Expose the remote driver API structs publicly.#249mrjana merged 1 commit intomoby:masterfrom erikh:expose-api
Conversation
|
Nice! Thanks Erik. Looks good at a scan, and I'll try it out today. |
|
Works fine with the weave plugin, and a definite improvement, so 👍 |
|
LGTM! Not sure if it's a good idea but just wondering if the file |
The Having said that, it would be nicely to enforce parity of |
drivers/remote/api/api.go
Outdated
There was a problem hiding this comment.
Can you pls move this under netutils package ?
There was a problem hiding this comment.
Yep I can!
Michael, I will rebase later today.
-Erik
On Jun 4, 2015, at 5:26 AM, Madhu Venugopal notifications@github.com wrote:
In drivers/remote/api/api.go #249 (comment):
- HostsPath string
- ResolvConfPath string
+}
+// LeaveRequest describes the API for detaching an endpoint from a sandbox.
+type LeaveRequest struct {
- NetworkID string
- EndpointID string
+}
+// LeaveResponse is the answer to LeaveRequest.
+type LeaveResponse struct {
- Response
+}
+func toAddr(ipAddr string) (*net.IPNet, error) {
Can you pls move this under netutils package ?—
Reply to this email directly or view it on GitHub https://github.com/docker/libnetwork/pull/249/files#r31715215.
|
@erikh any luck with this ? |
|
Working on this now.
|
|
This should be ready for review. Note that I fudged the merge a little, sorry about that and I hope it's not too much of an issue. |
|
@erikh Would it be more useful to also make the entire remote driver protocol as a package rather than just exposing the structs for JSON encoding? That way we hide all of plugin management and such from the client code and client code can just send events or react to events defined in terms of interfaces |
|
@mrjana I could make an attempt, but that's outside the scope of what I wanted to do here. If you want to give me a more detailed example of what you're looking for, I can attempt a plugin harness. Additionally, I need to deserialize the structs in a versioned way. I don't think an evented system will provide that without a lot of contortion. |
|
I say we create another issue re: making the remote driver protocol a package. It shouldn't prevent this being merged... |
|
Guys, I don’t even know what happened here, but the rebase was pretty clean and it’s still broken. I’ll see if I can figure it out tomorrow, but I can’t spend too much time on this.
|
|
Got it sorted. PTAL. Note that I moved both the public functions in |
|
Anything I can do to move this along? We're already depending on these structs in our netplugin. |
|
@erikh apologies on the delay. LGTM. |
|
LGTM |
Expose the remote driver API structs publicly.
There was a problem hiding this comment.
How come this is here rather than in driver.go? Alternatively: how come this is here, but the convenience functions for converting back and forth to string are not?
There was a problem hiding this comment.
Well it doesnae hurt ... let's fix it up in post
The diff sucks. Sorry in advance.
This exposes the message types formerly in
drivers/remote/messages.goand moves it intodrivers/remote/api. I have taken some care to pass golint but the comments are lacking, happy to fix this up more if that's desired, just need to know what to say.The other big thing is that I moved
maybeError, an interface thatapi.Responseconforms to, into the other driver file and madegetErrorpublic. This way they can split between.