Documentation ¶
Index ¶
- func IsComment(line string) bool
- type Hosts
- func (h *Hosts) Add(ip, comment string, hosts ...string) error
- func (h Hosts) Flush() error
- func (h *Hosts) Has(ip string, host string, forceFile bool) bool
- func (h *Hosts) IsWritable() bool
- func (h *Hosts) Load() error
- func (h *Hosts) Remove(ip string, hosts ...string) error
- func (h *Hosts) RemoveSection() error
- type HostsLine
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Hosts ¶
Hosts Represents a hosts file.
func (*Hosts) IsWritable ¶
IsWritable Return ```true``` if hosts file is writable.
func (*Hosts) Load ¶
Load the hosts file into ```l.Lines```. ```Load()``` is called by ```NewHosts()``` and ```Hosts.Flush()``` so you generally you won't need to call this yourself.
func (*Hosts) RemoveSection ¶
RemoveSection removes an entire section from the hostsfile
Click to show internal directories.
Click to hide internal directories.