Documentation ¶
Index ¶
- Variables
- type Host
- func (h *Host) Active() bool
- func (h *Host) AddDomain(domain string)
- func (h *Host) Address() string
- func (h *Host) AppendComment(text string)
- func (h *Host) Block() string
- func (h *Host) Changed() bool
- func (h *Host) Comment() string
- func (h *Host) Domains() []string
- func (h *Host) Empty() bool
- func (h *Host) Equals(host *Host) bool
- func (h *Host) GetActualInfo() (label, tooltip string)
- func (h *Host) HasDomain(needle string) (found bool)
- func (h *Host) Importance() HostImportance
- func (h *Host) IsComment() bool
- func (h *Host) IsOnlyComment() (onlyComment bool)
- func (h *Host) Line() string
- func (h *Host) Lookup() string
- func (h *Host) Name() (ipOrName string)
- func (h *Host) PerformLookup() (found []net.IP, err error)
- func (h *Host) RemoveDomain(domain string)
- func (h *Host) SetActive(active bool)
- func (h *Host) SetAddress(value string)
- func (h *Host) SetComment(text string)
- func (h *Host) SetDomains(text string)
- func (h *Host) SetLookup(value string)
- func (h *Host) String() string
- type HostImportance
- type HostInfo
- type Hostfile
- func (eh *Hostfile) Hosts() []*Host
- func (eh *Hostfile) IndexOf(host *Host) int
- func (eh *Hostfile) InsertHost(host *Host, idx int)
- func (eh *Hostfile) Len() int
- func (eh *Hostfile) MoveHost(from, to int)
- func (eh *Hostfile) RemoveHost(idx int)
- func (eh *Hostfile) Save() (err error)
- func (eh *Hostfile) Validate() (errs []error)
Constants ¶
This section is empty.
Variables ¶
View Source
var (
HostValidations = map[string]string{
"localhost": "IPv4 (localhost)",
"ip6-localhost": "IPv6 (localhost)",
"ip6-loopback": "IPv6 (loopback)",
"ip6-allnodes": "IPv6 (all nodes)",
"ip6-allrouters": "IPv6 (all routers)",
}
)
Functions ¶
This section is empty.
Types ¶
type Host ¶
func NewComment ¶
func NewHostFromInfo ¶
func (*Host) AppendComment ¶
func (*Host) GetActualInfo ¶
func (*Host) Importance ¶
func (h *Host) Importance() HostImportance
func (*Host) IsOnlyComment ¶
func (*Host) RemoveDomain ¶
func (*Host) SetAddress ¶
func (*Host) SetComment ¶
func (*Host) SetDomains ¶
type HostImportance ¶
type HostImportance string
const ( HostNotImportant HostImportance = "none" HostImportanceIPv4 HostImportance = "ipv4" HostImportanceIPv6 HostImportance = "ipv6" )
type HostInfo ¶
type HostInfo struct {
// contains filtered or unexported fields
}
func (HostInfo) SameHostInfo ¶
type Hostfile ¶
type Hostfile struct { Path string Comment string sync.RWMutex // contains filtered or unexported fields }
func (*Hostfile) InsertHost ¶
func (*Hostfile) RemoveHost ¶
Click to show internal directories.
Click to hide internal directories.