network

package
v1.0.14 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2022 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddPeer added in v1.0.9

func AddPeer(name string, peer v1alpha.VPNPeer)

func AssignPublicIP

func AssignPublicIP(localIP net.IP, publicIP net.IP)

AssignPublicIP assign the publicIP to the interface with the localIP.

func AssignVPNIP added in v1.0.9

func AssignVPNIP(name string, ipv4 utils.IPWithMask, ipv6 utils.IPWithMask)

func InitializeVPN added in v1.0.9

func InitializeVPN(name string, privateKey string, listenPort int)

func LocalIPv4

func LocalIPv4() net.IP

LocalIPv4 returns the IPv4 address configured for the main network interface.

func PublicIPv4

func PublicIPv4() net.IP

PublicIPv4 returns the public IPv4 address of the requester.

func RewritePublicIP

func RewritePublicIP(localIP net.IP, publicIP net.IP)

RewritePublicIP adds iptables rules to rewrite incoming packets with the publicIP and outgoing packets with the localIP. This counteracts cloud "Internet Gateway" NATs.

func SetHostname

func SetHostname(hostname string)

SetHostname sets the node hostname and update the hosts file.

func SetKubeletNodeIP

func SetKubeletNodeIP(kubeletEnvFile string, ip net.IP)

SetKubeletNodeIP sets the node IP in the kubelet configuration.

Types

type GeoIPResponse

type GeoIPResponse struct {
	Status      string  `json:"success"`
	Country     string  `json:"country"`
	CountryCode string  `json:"countryCode"`
	Region      string  `json:"region"`
	RegionName  string  `json:"regionName"`
	City        string  `json:"city"`
	Zip         string  `json:"zip"`
	Lat         float64 `json:"lat"`
	Lon         float64 `json:"lon"`
	Timezone    string  `json:"timezone"`
	ISP         string  `json:"isp"`
	Org         string  `json:"org"`
	As          string  `json:"as"`
	Query       string  `json:"query"`
}

func GeoIP

func GeoIP() GeoIPResponse

GeoIP returns the geographical location of the requester IP address using an external service.

Jump to

Keyboard shortcuts

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