etchosts

package
v1.4.2-0...-9c5635a Latest Latest
Warning

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

Go to latest
Published: May 17, 2015 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Build

func Build(path, IP, hostname, domainname string, extraContent []Record) error

Build function path is path to host file string required IP, hostname, and domainname set main record leave empty for no master record extraContent is an array of extra host records.

func Update

func Update(path, IP, hostname string) error

Update all IP addresses where hostname matches. path is path to host file IP is new IP address hostname is hostname to search for to replace IP

Types

type Record

type Record struct {
	Hosts string
	IP    string
}

Structure for a single host record

func (Record) WriteTo

func (r Record) WriteTo(w io.Writer) (int64, error)

Writes record to file and returns bytes written or error

Jump to

Keyboard shortcuts

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