Simplifies Platform Specific Interface Creation

The interface `Config` object is now passed directly into each creation
function in order to more easily use additional options.

In addition, the linux and darwin parameters were split to better
capture different options for each platform.
This commit is contained in:
Matthew Ellison 2017-05-22 12:25:48 -04:00
parent 80f6655041
commit 70591d2499
No known key found for this signature in database
GPG key ID: A815A44BDC8DD409
9 changed files with 38 additions and 48 deletions

View file

@ -1,18 +0,0 @@
// +build linux darwin
package water
// PlatformSpecificParams defines parameters in Config that are specific to
// Linux and macOS. A zero-value of such type is valid, yielding an interface
// with OS defined name.
type PlatformSpecificParams struct {
// Name is the name to be set for the interface to be created. This overrides
// the default name assigned by OS such as tap0 or tun0. A zero-value of this
// field, i.e. an empty string, indicates that the default name should be
// used.
Name string
}
func defaultPlatformSpecificParams() PlatformSpecificParams {
return PlatformSpecificParams{}
}