mirror of
https://github.com/fumiama/water.git
synced 2026-06-10 21:24:44 +08:00
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:
17
params_linux.go
Normal file
17
params_linux.go
Normal file
@@ -0,0 +1,17 @@
|
||||
|
||||
package water
|
||||
|
||||
// PlatformSpecificParams defines parameters in Config that are specific to
|
||||
// Linux. 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{}
|
||||
}
|
||||
Reference in New Issue
Block a user