Package geo manages the geoip.dat / geosite.dat databases Xray needs to
resolve geosite:/geoip: routing rules. They live in an asset dir pointed at by
XRAY_LOCATION_ASSET.
Categories parses the category names out of geosite.dat and geoip.dat in dir.
Both files are v2ray's GeoSiteList/GeoIPList protobuf: a flat sequence of
length-delimited entries (field 1), each whose first field (1) is the
uppercase category code (string). We only need that code, so a tiny reader
avoids pulling in the full xray proto. Codes are returned lowercased + sorted.
Refresh re-downloads every database into dir regardless of whether it already
exists, pulling the latest published version. It attempts all files and returns
the first error encountered.
Status returns metadata for the geo databases in dir. The file mtime doubles
as the "last downloaded" timestamp (download writes atomically via rename).