Discover Packages
github.com/LaurentGoderre/moby
libnetwork
etchosts
package
Version:
v0.0.0-...-8eba9bf
Opens a new window with list of versions in this module.
Published: Oct 25, 2024
License: Apache-2.0
Opens a new window with license information.
Imports: 8
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation Source Files Index Constants Variables Functions Types Add(path, recs) Build(path, extraContent) BuildNoIPv6(path, extraContent) Delete(path, recs) Drop(path) Update(path, IP, hostname) type Record (r) WriteTo(w)
Documentation
¶
Add adds an arbitrary number of Records to an already existing /etc/hosts file
Build function
path is path to host file string required
extraContent is an array of extra host records.
BuildNoIPv6 is the same as Build, but will not include IPv6 entries.
Delete deletes an arbitrary number of Records already existing in /etc/hosts file
FIXME(robmry) - this only matches on hostname, not address. So, if a container
is connected to two networks then disconnected from one of them, the hosts
entries for both networks are deleted.
Drop drops the path string from the path cache
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
Record Structure for a single host record
WriteTo writes record to file and returns bytes written or error
Source Files
¶
Click to show internal directories.
Click to hide internal directories.