diff --git a/docs/overrides/home.html b/docs/overrides/home.html index ff8366a..cf2233a 100644 --- a/docs/overrides/home.html +++ b/docs/overrides/home.html @@ -23,8 +23,6 @@
- txeh manages the /etc/hosts file from Go and from the shell. Add, remove, list, and query hostname-to-IP mappings without hand-editing. Mutex-protected for safe concurrent use, comment-aware so entries from different sources stay separable, and cross-platform across Linux, macOS, and Windows. The library powers kubefwd's per-service hostname resolution and ships as a standalone CLI. + txeh manages the /etc/hosts file from Go and from the shell. Add, remove, list, and query hostname-to-IP mappings without hand-editing. Mutex-protected for safe concurrent use, comment-aware so entries from different sources stay separable, and cross-platform across Linux, macOS, and Windows. The library powers kubefwd's per-service hostname resolution and ships as a standalone CLI.
/etc/hosts
IPv4 and IPv6, CIDR-based bulk add and remove, dry-run preview, optional DNS cache flush after writes, and an in-memory mode that operates on raw text instead of a file. Apache 2.0, originally built to support kubefwd for Kubernetes service forwarding. @@ -214,71 +211,57 @@
Single-host or bulk operations. AddHost, AddHosts, RemoveHost, RemoveAddress, RemoveCIDRs. Operations are idempotent; re-adding a hostname is a no-op.
AddHost
AddHosts
RemoveHost
RemoveAddress
RemoveCIDRs
All public methods take an internal mutex. Daemons, controllers, and tools that mutate hosts from multiple goroutines (kubefwd among them) can call them directly without external locking.
AddHostWithComment tags entries with a source string. RemoveByComment removes everything tagged with that source. The library re-renders the file without losing any comment or blank line.
AddHostWithComment
RemoveByComment
ListAddressesByHost, ListHostsByIP, ListHostsByComment, ListHostsByCIDR. Read-only inspection without parsing or rewriting.
ListAddressesByHost
ListHostsByIP
ListHostsByComment
ListHostsByCIDR
--flush on the CLI or TXEH_AUTO_FLUSH=1 in the environment runs the OS-native flush command after writes. dscacheutil on macOS, resolvectl on Linux, ipconfig /flushdns on Windows.
--flush
TXEH_AUTO_FLUSH=1
dscacheutil
resolvectl
ipconfig /flushdns
Pass RawText to NewHosts and operate on a string. Save() errors as expected (no path); RenderHostsFile() returns the mutated text. Useful in unit tests and ephemeral fixtures.
RawText
NewHosts
Save()
RenderHostsFile()
Full type and method reference in the API docs.
txn2 / org
txn2.com ↗ canonical home of the txn2 open source organization
apache 2.0 license · ·· UTC
apache 2.0 license