ddevhosts

package
v1.23.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const WSL2WindowsHostsFile = `/mnt/c/Windows/system32/drivers/etc/hosts`

Variables

This section is empty.

Functions

This section is empty.

Types

type DdevHosts

type DdevHosts struct {
	*goodhosts.Hosts // provides all exported functions from goodhosts
}

DdevHosts uses composition to absorb all exported functions of goodhosts

func New

func New() (*DdevHosts, error)

New is a simple wrapper on goodhosts.NewHosts()

func NewCustomHosts

func NewCustomHosts(osHostsFilePath string) (*DdevHosts, error)

func (DdevHosts) GetIPPosition

func (h DdevHosts) GetIPPosition(ip string) int

GetIPPosition is the same as the unexported getIpPosition, providing the position of the line in the hosts file that supports the IP address we're looking for. Or it returns -1 if none is found yet.

Jump to

Keyboard shortcuts

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