Documentation ¶
Overview ¶
Package hosts provides an implementation to model an /etc/hosts file.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrorInvalidHostName = errors.New("invalid host-name")
View Source
var ErrorInvalidIp = errors.New("invalid ip")
View Source
var ErrorNilEntry = errors.New("entry is nil")
Functions ¶
This section is empty.
Types ¶
type Entry ¶
type Entry interface { Ip() net.IP IpString() string HostNames() []string AddHostName(hostName string) error String() string Contains(hostName string) bool }
An Entry represent a line in /etc/hosts with multiple hosts associate to one ip.
func CloneEntry ¶
func NewEntryIp ¶
NewEntryIp returns an Entry which contains the given ip.
Directories ¶
Path | Synopsis |
---|---|
Package hostsfile provides an interface to interact with etc/hosts-file.
|
Package hostsfile provides an interface to interact with etc/hosts-file. |
Package parser provides an interface to parse line/file-entry from/to hosts-file.
|
Package parser provides an interface to parse line/file-entry from/to hosts-file. |
Click to show internal directories.
Click to hide internal directories.