network

package
v1.0.6 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssignPublicIP

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

AssignPublicIP assign the publicIP to the interface with the localIP.

func PublicIPv4

func PublicIPv4() net.IP

func RewritePublicIP

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

Cloud providers assign a public IP to instances through NAT. The instance only sees an private _internal_ IP. This is problematic for Kubernetes, which expects to see the public IP on the interface. In this script, we assign the public IP to the instance interface.

func SetHostname

func SetHostname(hostname string)

func SetKubeletNodeIP

func SetKubeletNodeIP(kubeletEnvFile string, ip net.IP)

Types

type GeoIPResponse

type GeoIPResponse struct {
	City        string  `json:"string"`
	CountryCode string  `json:"country_code"`
	CountryName string  `json:"country_name"`
	IP          net.IP  `json:"ip"`
	Latitude    float64 `json:"latitude"`
	Longitude   float64 `json:"longitude"`
	RegionCode  string  `json:"region_code"`
	RegionName  string  `json:"region_name"`
	Timezone    string  `json:"time_zone"`
}

func GeoIP

func GeoIP() GeoIPResponse

Jump to

Keyboard shortcuts

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