net

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2016 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddDomainToIP

func AddDomainToIP(domain string, ip string) (bool, error)

AddDomainToIP add a record of domain to system host file

func PrintHosts

func PrintHosts(hosts []Host)

PrintHosts print a list of host as table

func RemoveDomain

func RemoveDomain(domain string) (bool, error)

RemoveDomain remove a record of domain form system host file

Types

type Host

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

Host has ip, name, line some impl and util functions are from https://golang.org/src/net/hosts.go

func ParseHosts

func ParseHosts() []Host

ParseHosts parse system host file

func (Host) Print

func (host Host) Print()

Print print a host object as a table row

Jump to

Keyboard shortcuts

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