Documentation
¶
Overview ¶
Code generated by go generate
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DiscoverGateway ¶
DiscoverGateway is the OS independent function to get the default gateway
Example ¶
gateway, err := DiscoverGateway() if err != nil { fmt.Println(err) } else { fmt.Println("Gateway:", gateway.String()) }
Output:
func DiscoverInterface ¶ added in v1.0.14
DiscoverInterface is the OS independent function to call to get the default network interface IP that uses the default gateway
Types ¶
type ErrCantParse ¶ added in v1.0.14
type ErrCantParse struct{}
ErrCantParse is returned if the route table is garbage.
func (*ErrCantParse) Error ¶ added in v1.0.14
func (*ErrCantParse) Error() string
type ErrInvalidRouteFileFormat ¶ added in v1.0.14
type ErrInvalidRouteFileFormat struct {
// contains filtered or unexported fields
}
ErrInvalidRouteFileFormat is returned if the format of /proc/net/route is unexpected on Linux systems. Please raise an issue.
func (*ErrInvalidRouteFileFormat) Error ¶ added in v1.0.14
func (e *ErrInvalidRouteFileFormat) Error() string
type ErrNoGateway ¶ added in v1.0.14
type ErrNoGateway struct{}
ErrNoGateway is returned if a valid gateway entry was not found in the route table.
func (*ErrNoGateway) Error ¶ added in v1.0.14
func (*ErrNoGateway) Error() string
type ErrNotImplemented ¶ added in v1.0.14
type ErrNotImplemented struct{}
ErrNotImplemented is returned if your operating system is not supported by this package. Please raise an issue to request support.
func (*ErrNotImplemented) Error ¶ added in v1.0.14
func (*ErrNotImplemented) Error() string
Click to show internal directories.
Click to hide internal directories.