Documentation ¶
Index ¶
- Constants
- Variables
- func DNSLookuper(addr string, queryServers []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 ReadFile(path string) string
- func SignRequest(token string, req *interfaces.SlaveRequest) string
- func SignRequestOld(token string, req *interfaces.SlaveRequestV1) string
- func StandardDeviation(data []float64) float64
- 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 ¶
View Source
const (
IDENTIFIER = "Speed"
)
View Source
const LOGO string = "" /* 316-byte string literal not displayed */
Variables ¶
View Source
var BRAND string
View Source
var BUILDCOUNT string
View Source
var BUILDTOKEN string
View Source
var COMMIT string
View Source
var COMPILATIONTIME string
View Source
var DnsCache *obliviousmap.ObliviousMap[*interfaces.IPStacks]
View Source
var MaxMindDBs []*maxminddb.Reader
View Source
var VERSION = "4.5.0"
View Source
var VerboseLevel = LTWarn
Functions ¶
func DNSLookuper ¶
queryServer = "8.8.8.8:53"
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 SignRequestOld ¶
func SignRequestOld(token string, req *interfaces.SlaveRequestV1) string
func WrapErrorPure ¶
Types ¶
type GlobalConfig ¶
type GlobalConfig struct { Token string Binder string WhiteList []string AllowIPs []string SpeedLimit uint64 TaskLimit uint PauseSecond uint ConnTaskTreading uint MiaoKoSignedTLS bool NoSpeedFlag bool MaxmindDB string Path 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) ValidateWSPath ¶ added in v0.0.4
func (gc *GlobalConfig) ValidateWSPath(path string) bool
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.