Removes Deprecated "New" Functions

This commit is contained in:
Matthew Ellison 2017-05-22 15:31:28 -04:00
parent 3f281b0517
commit 80f6655041
No known key found for this signature in database
GPG key ID: A815A44BDC8DD409

26
if.go
View file

@ -1,6 +1,8 @@
package water package water
import "io" import (
"io"
)
// Interface is a TUN/TAP interface. // Interface is a TUN/TAP interface.
type Interface struct { type Interface struct {
@ -49,28 +51,6 @@ func New(config Config) (ifce *Interface, err error) {
return newDev(config) return newDev(config)
} }
// NewTAP creates a new TAP interface whose name is ifName. If ifName is empty, a
// default name (tap0, tap1, ... ) will be assigned. ifName should not exceed
// 16 bytes. TAP interfaces are not supported on darwin.
// ifName cannot be specified on windows, you will need ifce.Name() to use some cmds.
//
// Note: this function is deprecated and will be removed from the library.
// Please use New() instead.
func NewTAP(ifName string) (ifce *Interface, err error) {
return newTAP(ifName)
}
// NewTUN creates a new TUN interface whose name is ifName. If ifName is empty, a
// default name (tap0, tap1, ... ) will be assigned. ifName should not exceed
// ifName cannot be specified on windows, you will need ifce.Name() to use some cmds.
//
// Note: this function is deprecated and will be removed from the library.
// Please use New() instead.
// 16 bytes. Setting interface name is NOT supported on darwin.
func NewTUN(ifName string) (ifce *Interface, err error) {
return newTUN(ifName)
}
// IsTUN returns true if ifce is a TUN interface. // IsTUN returns true if ifce is a TUN interface.
func (ifce *Interface) IsTUN() bool { func (ifce *Interface) IsTUN() bool {
return !ifce.isTAP return !ifce.isTAP