moby / vpnkit

A toolkit for embedding VPN capabilities in your application
Apache License 2.0
1.1k stars 187 forks source link

Go: pkg/vpnkit: simplify the port interface #436

Closed djs55 closed 5 years ago

djs55 commented 5 years ago

We now have a vpnkit.Client:

// Client exposes and unexposes ports on vpnkit.
type Client interface {
    Expose(context.Context, *Port) error
    Unexpose(context.Context, *Port) error
    ListExposed(context.Context) ([]*Port, error)
}

which we can use instead of the ad-hoc functions spread over both the package (vpnkit.ListExposed) and Ports (port.Expose)

This should make this library easier to Mock for testing.

Signed-off-by: David Scott dave.scott@docker.com