hosts

package
v0.0.0-...-08ad115 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2018 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package hosts provides address lookups from local hostfile (usually /etc/hosts).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Positive value enables polling
	Poll    int
	Verbose bool
}

Config stores options for hostsfile

type Hostsfile

type Hostsfile struct {
	// contains filtered or unexported fields
}

Hostsfile represents a file containing hosts

func NewHostsfile

func NewHostsfile(path string, config *Config) (*Hostsfile, error)

NewHostsfile returns a new Hostsfile object

func (*Hostsfile) FindHosts

func (h *Hostsfile) FindHosts(name string) (addrs []net.IP, err error)

func (*Hostsfile) FindReverse

func (h *Hostsfile) FindReverse(name string) (host string, err error)

Jump to

Keyboard shortcuts

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