WireGuard / wgctrl-go

Package wgctrl enables control of WireGuard interfaces on multiple platforms.
https://godoc.org/golang.zx2c4.com/wireguard/wgctrl
MIT License
727 stars 85 forks source link

Expose the Client interface #80

Closed fastcat closed 4 years ago

fastcat commented 4 years ago

I'm working on an app that uses this library, and for writing my tests it would be very nice to generate a mock for the Client. However, what's exposed/exported from this library is only a concrete wrapper type which implements that interface, but not the interface itself.

Obviously I can copy-paste that interface definition, but being able to directly use the upstream interface avoids some risks down the road.

mdlayher commented 4 years ago

Sorry, I'm not really interested in exposing that interface as I consider it to be an implementation detail. In addition, the API is not stable at this time.

I encourage making a small interface in your own code to stub out only the methods you're actually using.