hosts

package
v0.0.0-...-0c2dc4c Latest Latest
Warning

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

Go to latest
Published: May 9, 2018 License: MIT Imports: 9 Imported by: 1

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