{"modulePath":"github.com/docker/libnetwork","version":"v0.5.6","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package etchosts\n\n## Functions\n\n```go\nfunc Add(path string, recs []Record) error\n```\nAdd adds an arbitrary number of Records to an already existing /etc/hosts file\n\n```go\nfunc Build(path, IP, hostname, domainname string, extraContent []Record) error\n```\nBuild 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.\n\n```go\nfunc Delete(path string, recs []Record) error\n```\nDelete deletes an arbitrary number of Records already existing in /etc/hosts file\n\n```go\nfunc Drop(path string)\n```\nDrop drops the path string from the path cache\n\n```go\nfunc Update(path, IP, hostname string) error\n```\nUpdate 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\n\n## Types\n\n```go\ntype Record struct {\n\tHosts string\n\tIP    string\n}\n```\nRecord Structure for a single host record\n\n```go\nfunc (r Record) WriteTo(w io.Writer) (int64, error)\n```\nWriteTo writes record to file and returns bytes written or error\n\n","path":"github.com/docker/libnetwork/etchosts","name":"etchosts","synopsis":"","isRedistributable":true}
