docker: Index | Files

package etchosts

import ""


Package Files


func Add Uses

func Add(path string, recs []Record) error

Add adds an arbitrary number of Records to an already existing /etc/hosts file

func Build Uses

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 Delete Uses

func Delete(path string, recs []Record) error

Delete deletes an arbitrary number of Records already existing in /etc/hosts file

func Drop Uses

func Drop(path string)

Drop drops the path string from the path cache

func Update Uses

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

type Record Uses

type Record struct {
    Hosts string
    IP    string

Record Structure for a single host record

func (Record) WriteTo Uses

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

WriteTo writes record to file and returns bytes written or error

Package etchosts imports 9 packages (graph). Updated 2017-03-29. Refresh now. Tools for package owners. This is an inactive package (no imports and no commits in at least two years).