network

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: May 4, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddNameserversToInstance

func AddNameserversToInstance(sshRunner *ssh.SSHRunner, nameservers []NameServer)

AddNameserversToInstance will add additional nameservers to the end of the /etc/resolv.conf file inside the instance.

func CheckCRCLocalDNSReachableFromHost

func CheckCRCLocalDNSReachableFromHost(bundle *bundle.CrcBundleInfo, expectedIP string) error

func CreateResolvFile

func CreateResolvFile(values ResolvFileValues) (string, error)

func CreateResolvFileOnInstance

func CreateResolvFileOnInstance(sshRunner *ssh.SSHRunner, resolvFileValues ResolvFileValues)

func DetermineHostIP

func DetermineHostIP(instanceIP string) (string, error)

func HasGivenNameserversConfigured

func HasGivenNameserversConfigured(sshRunner *ssh.SSHRunner, nameserver NameServer) (bool, error)

HasGivenNameserversConfigured returns true if the instance uses a provided nameserver.

func HostIPs

func HostIPs() []string

HostIPs returns the IP addresses assigned to the host

func NetworkContains

func NetworkContains(network string, ip string) bool

NetworkContains returns true if the IP address belongs to the network given

func UriStringForDisplay

func UriStringForDisplay(uri string) (string, error)

func ValidateProxyURL

func ValidateProxyURL(proxyUrl string) error

ValidateProxyURL validates that the specified proxyURL is valid

Types

type NameServer

type NameServer struct {
	IPAddress string
}

type ProxyConfig

type ProxyConfig struct {
	HttpProxy  string
	HttpsProxy string
	// contains filtered or unexported fields
}

ProxyConfig keeps the proxy configuration for the current environment

var (
	DefaultProxy ProxyConfig
)

func NewProxyConfig

func NewProxyConfig() (*ProxyConfig, error)

NewProxyConfig creates a proxy configuration with the specified parameters. If an empty string is passed the corresponding environment variable is checked.

func NewProxyDefaults

func NewProxyDefaults(httpProxy, httpsProxy, noProxy string) (*ProxyConfig, error)

func (*ProxyConfig) AddNoProxy

func (p *ProxyConfig) AddNoProxy(host ...string)

AddNoProxy appends the specified host to the list of no proxied hosts.

func (*ProxyConfig) ApplyToEnvironment

func (p *ProxyConfig) ApplyToEnvironment()

Sets the current config as environment variables in the current process.

func (*ProxyConfig) GetNoProxyString

func (p *ProxyConfig) GetNoProxyString() string

func (*ProxyConfig) HttpProxyForDisplay

func (p *ProxyConfig) HttpProxyForDisplay() string

HttpProxy with hidden credentials

func (*ProxyConfig) HttpsProxyForDisplay

func (p *ProxyConfig) HttpsProxyForDisplay() string

HttpsProxy with hidden credentials

func (*ProxyConfig) IsEnabled

func (p *ProxyConfig) IsEnabled() bool

Enabled returns true if at least one proxy (HTTP or HTTPS) is configured. Returns false otherwise.

type ResolvFileValues

type ResolvFileValues struct {
	SearchDomains []SearchDomain
	NameServers   []NameServer
}

func GetResolvValuesFromHost

func GetResolvValuesFromHost() (*ResolvFileValues, error)

func GetResolvValuesFromInstance

func GetResolvValuesFromInstance(sshRunner *ssh.SSHRunner) (*ResolvFileValues, error)

type SearchDomain

type SearchDomain struct {
	Domain string
}

Jump to

Keyboard shortcuts

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