mirror of
https://github.com/therootcompany/golib.git
synced 2026-11-04 06:55:00 +00:00
PrefixSet: git-backed CIDR files via gitshallow, refreshed every 47 min. DomainSet: takes pre-parsed (staticPrefixes, domains []string); resolves hostnames every 5 min, retaining stale IPs on failure. Both use atomic-swapped ipcohort.Cohort for lock-free reads. ParseDomainSet(RecordReader) parses rows into prefixes and hostnames; caller constructs the record reader (e.g. csv.Reader with delimiter, comment char). RecordReader interface is satisfied by *csv.Reader. commaify uses plain string concat (integers max ~7 groups).
golib
Sometimes a little copying, sometimes a little dependency. Too small for their own repos.
The default branch is dev, but the stable, versioned tags are based on main.
Also, my Go Cheatsheet:
Languages
Go
100%