network

package
v2.36.0 Latest Latest
Warning

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

Go to latest
Published: May 13, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddNameserversToInstance

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

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

func CreateResolvFile

func CreateResolvFile(values ResolvFileValues) (string, error)

func HasGivenNameserversConfigured

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

HasGivenNameserversConfigured returns true if the instance uses a provided nameserver.

func SuccessfullyAppliedMode

func SuccessfullyAppliedMode(_ string, _ interface{}) string

func UpdateResolvFileOnInstance added in v2.36.0

func UpdateResolvFileOnInstance(sshRunner *ssh.Runner, resolvFileValues ResolvFileValues) error

func ValidateMode

func ValidateMode(val interface{}) (bool, string)

Types

type Mode

type Mode string
const (
	SystemNetworkingMode Mode = "system"
	UserNetworkingMode   Mode = "user"
)

func ParseMode

func ParseMode(input string) Mode

func (Mode) String

func (m Mode) String() string

type NameServer

type NameServer struct {
	IPAddress string
}

type ResolvFileValues

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

func GetResolvValuesFromHost

func GetResolvValuesFromHost() (*ResolvFileValues, error)

func GetResolvValuesFromInstance

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

func (*ResolvFileValues) GetNameServer added in v2.36.0

func (vals *ResolvFileValues) GetNameServer() []string

func (*ResolvFileValues) GetSearchDomains added in v2.36.0

func (vals *ResolvFileValues) GetSearchDomains() []string

type SearchDomain

type SearchDomain struct {
	Domain string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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