Documentation ¶
Index ¶
- Constants
- func CreateEdgeMeshDevice(deviceName, deviceIP string) error
- func GetInterfaceIP(name string) (net.IP, error)
- func HttpRequestToBytes(req *http.Request) ([]byte, error)
- func IsClosedError(err error) bool
- func IsEOFError(err error) bool
- func IsStreamResetError(err error) bool
- func IsTimeoutError(err error) bool
- func IsTooManyFDsError(err error) bool
- func ProxyConn(in, out net.Conn)
- func ProxyConnUDP(inConn net.Conn, udpConn *net.UDPConn)
- type NetifManager
Constants ¶
const IPv4Mask = 4
Variables ¶
This section is empty.
Functions ¶
func CreateEdgeMeshDevice ¶
func GetInterfaceIP ¶
GetInterfaceIP get net interface ipv4 address
func HttpRequestToBytes ¶
HttpRequestToBytes transforms http.Request to bytes
func IsClosedError ¶
func IsEOFError ¶
func IsStreamResetError ¶
func IsTimeoutError ¶
func IsTooManyFDsError ¶
Types ¶
type NetifManager ¶
NetifManager copy and update from https://github.com/kubernetes/dns/blob/1.21.0/pkg/netif/netif.go
func NewNetifManager ¶
func NewNetifManager(ips []net.IP) *NetifManager
NewNetifManager returns a new instance of NetifManager with the ip address set to the provided values These ip addresses will be bound to any devices created by this instance.
func (*NetifManager) AddBridgeDevice ¶
func (m *NetifManager) AddBridgeDevice(name string) error
AddBridgeDevice creates a bridge device with the given name. It also binds the ip address of the NetifManager instance to this device. This function returns an error if the device exists or if address binding fails.
func (*NetifManager) EnsureBridgeDevice ¶
func (m *NetifManager) EnsureBridgeDevice(name string) (bool, error)
EnsureBridgeDevice checks for the presence of the given bridge device and creates one if it does not exist. Returns a boolean to indicate if this device was found and error if any.
func (*NetifManager) RemoveBridgeDevice ¶
func (m *NetifManager) RemoveBridgeDevice(name string) error
RemoveBridgeDevice deletes the bridge device with the given name.
func (*NetifManager) SetupBridgeDevice ¶
func (m *NetifManager) SetupBridgeDevice(name string) error
SetupBridgeDevice setup the bridge device with the given name.