interfaces

package
v0.0.0-...-2aa077c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 9, 2020 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BindToInterface

func BindToInterface(fd int, ifname string) error

func GetInterfacesFunc

func GetInterfacesFunc(matcher InterfaceMatcher) ([]net.Interface, error)

GetInterfacesFunc loops through the available network interfaces, and returns a list of interfaces for which the passed InterfaceMatcher function returns true.

func GetLoopbackInterfaces

func GetLoopbackInterfaces() ([]net.Interface, error)

GetLoopbackInterfaces returns a list of loopback interfaces.

func GetNonLoopbackInterfaces

func GetNonLoopbackInterfaces() ([]net.Interface, error)

GetNonLoopbackInterfaces returns a list of non-loopback interfaces.

Types

type InterfaceMatcher

type InterfaceMatcher func(net.Interface) bool

InterfaceMatcher is a function type used to match the interfaces we want. See GetInterfacesFunc below for usage.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL