Documentation
¶
Index ¶
- Variables
- func DNSLookuper(addr string, queryServers []string) []net.IP
- func DomainPreheating(url string) net.IP
- func Download(url string) (*http.Response, error)
- func DownloadBytes(url string) ([]byte, error)
- func FindAndExtract(gzipReader io.Reader, filters ...regexp.Regexp) (map[string][]byte, error)
- func LoadMaxMindDB(pathList string) error
- func LogTypeToStr(lt LogType) string
- func LookupIPv46(addr string, retry int, queryServers []string) *interfaces.IPStacks
- func MakeSysChan() chan os.Signal
- func PrintLogUnit(lu *LogUnit)
- func RandomUUID() string
- func SignRequest(token string, req *interfaces.SlaveRequest) string
- func ToJSON(a any) string
- func WrapError(desc string, fn func() error, onError ...func(err error)) (err error)
- func WrapErrorPure(desc string, erro any) (err error)
- type GlobalConfig
- type LogType
- type LogUnit
- func DBase(t LogType, a ...interface{}) *LogUnit
- func DBasef(t LogType, format string, a ...interface{}) *LogUnit
- func DBlackhole(a ...interface{}) *LogUnit
- func DBlackholef(format string, a ...interface{}) *LogUnit
- func DError(a ...interface{}) *LogUnit
- func DErrorE(err error, a ...interface{}) *LogUnit
- func DErrorEf(err error, format string, a ...interface{}) *LogUnit
- func DErrorf(format string, a ...interface{}) *LogUnit
- func DInfo(a ...interface{}) *LogUnit
- func DInfof(format string, a ...interface{}) *LogUnit
- func DLog(a ...interface{}) *LogUnit
- func DLogf(format string, a ...interface{}) *LogUnit
- func DWarn(a ...interface{}) *LogUnit
- func DWarnf(format string, a ...interface{}) *LogUnit
- type MMDBResult
Constants ¶
This section is empty.
Variables ¶
View Source
var DnsCache *obliviousmap.ObliviousMap[*interfaces.IPStacks]
View Source
var MaxMindDBs []*maxminddb.Reader
View Source
var VerboseLevel = LTWarn
Functions ¶
func DNSLookuper ¶
queryServer = "8.8.8.8:53"
func DomainPreheating ¶
func DownloadBytes ¶
func FindAndExtract ¶
func LoadMaxMindDB ¶
func LogTypeToStr ¶
func LookupIPv46 ¶
func LookupIPv46(addr string, retry int, queryServers []string) *interfaces.IPStacks
func MakeSysChan ¶
func PrintLogUnit ¶
func PrintLogUnit(lu *LogUnit)
func RandomUUID ¶
func RandomUUID() string
func SignRequest ¶
func SignRequest(token string, req *interfaces.SlaveRequest) string
func WrapErrorPure ¶
Types ¶
type GlobalConfig ¶
type GlobalConfig struct {
Token string
Binder string
WhiteList []string
SpeedLimit uint64
PauseSecond uint
ConnTaskTreading uint
MiaoKoSignedTLS bool
NoSpeedFlag bool
MaxmindDB string
}
var GCFG GlobalConfig
func (*GlobalConfig) InWhiteList ¶
func (gc *GlobalConfig) InWhiteList(invoker string) bool
func (*GlobalConfig) SignRequest ¶
func (gc *GlobalConfig) SignRequest(req *interfaces.SlaveRequest) string
func (*GlobalConfig) VerifyRequest ¶
func (gc *GlobalConfig) VerifyRequest(req *interfaces.SlaveRequest) bool
type MMDBResult ¶
type MMDBResult struct {
IP string
Reverse string
Via string
ASN int `maxminddb:"autonomous_system_number"`
ASNOrg string `maxminddb:"autonomous_system_organization"`
City struct {
GeoNameID int `maxminddb:"geoname_id"`
Names struct {
EN string `maxminddb:"en"`
JA string `maxminddb:"ja"`
ZH string `maxminddb:"zh-CN"`
} `maxminddb:"names"`
} `maxminddb:"city"`
Continent struct {
Code string `maxminddb:"code"`
GeoNameID int `maxminddb:"geoname_id"`
Names struct {
EN string `maxminddb:"en"`
JA string `maxminddb:"ja"`
ZH string `maxminddb:"zh-CN"`
} `maxminddb:"names"`
} `maxminddb:"continent"`
Country struct {
ISOCode string `maxminddb:"iso_code"`
GeoNameID int `maxminddb:"geoname_id"`
Names struct {
EN string `maxminddb:"en"`
JA string `maxminddb:"ja"`
ZH string `maxminddb:"zh-CN"`
} `maxminddb:"names"`
} `maxminddb:"country"`
RegisteredCountry struct {
ISOCode string `maxminddb:"iso_code"`
GeoNameID int `maxminddb:"geoname_id"`
Names struct {
EN string `maxminddb:"en"`
JA string `maxminddb:"ja"`
ZH string `maxminddb:"zh-CN"`
} `maxminddb:"names"`
} `maxminddb:"registered_country"`
Location struct {
Accuracy int `maxminddb:"accuracy_radius"`
Latitude float32 `maxminddb:"latitude"`
Longitude float32 `maxminddb:"longitude"`
TimeZone string `maxminddb:"time_zone"`
} `maxminddb:"location"`
}
func QueryMaxMindDB ¶
func QueryMaxMindDB(rawIp string) *MMDBResult
Source Files
¶
Click to show internal directories.
Click to hide internal directories.