Documentation ¶
Index ¶
- Constants
- Variables
- type Datahub
- func (dh *Datahub) GetDomainConfigData() []map[string]interface{}
- func (dh *Datahub) GetDomainConfigOptions() []string
- func (dh *Datahub) GetKeywordConfigData() []map[string]interface{}
- func (dh *Datahub) GetNetworksConfigData() []map[string]interface{}
- func (dh *Datahub) GetNetworksConfigOptions() []string
- func (dh *Datahub) LoadGeoIPFromDAT(tag string) (*v2data.GeoIP, error)
- func (dh *Datahub) LoadGeoSiteFromDAT(country string) (*v2data.GeoSite, error)
- func (dh *Datahub) MatchEcs(tag string, client string) net.IP
- func (dh *Datahub) MatchGeoNet(tag string, net iplib.Net) bool
- func (dh *Datahub) MatchGeoip(tag string, ip net.IP) bool
- func (dh *Datahub) MatchGeosite(matchType, tag string, name string) bool
- func (dh *Datahub) MatchKeyword(tag string, name string) bool
- func (dh *Datahub) MatchNet(tag string, ns iplib.Net) bool
- func (dh *Datahub) MatchNetByStr(tag string, ns string) bool
- func (dh *Datahub) MixMatch(tag string, name string) bool
- func (dh *Datahub) MixMatchNet(tag string, ns iplib.Net) (bool, string)
- func (dh *Datahub) MixMatchNetByStr(tag string, ns string) (bool, string)
- func (dh *Datahub) MixMatchTags(tags []string, name string) (bool, string)
- func (dh *Datahub) Name() string
- func (dh *Datahub) NotifyMessage(topic string, state *request.Request)
- func (dh *Datahub) OnShutdown() error
- func (dh *Datahub) OnStartup() error
- func (dh *Datahub) Push(dlog tsdb.MdnsLog)
- func (dh *Datahub) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (int, error)
- func (dh *Datahub) Sid() string
- func (dh *Datahub) ToDnstap(host string, state *request.Request, reply *dns.Msg, start time.Time)
- func (dh *Datahub) TsDB() *tsdb.TsDB
- type DnsNotify
Constants ¶
View Source
const ( GlobalTag = "global" DomainMatcher = "domain" NetworkMatcher = "network" KeywordMatcher = "keyword" )
View Source
const ( MIMEApplicationJSON = "application/json" MIMEApplicationJSONCharsetUTF8 = MIMEApplicationJSON + "; " + charsetUTF8 MIMEApplicationJavaScript = "application/javascript" MIMEApplicationJavaScriptCharsetUTF8 = MIMEApplicationJavaScript + "; " + charsetUTF8 MIMEApplicationXML = "application/xml" MIMEApplicationXMLCharsetUTF8 = MIMEApplicationXML + "; " + charsetUTF8 MIMETextXML = "text/xml" MIMETextXMLCharsetUTF8 = MIMETextXML + "; " + charsetUTF8 MIMEApplicationForm = "application/x-www-form-urlencoded" MIMEApplicationProtobuf = "application/protobuf" MIMEApplicationMsgpack = "application/msgpack" MIMETextHTML = "text/html" MIMETextHTMLCharsetUTF8 = MIMETextHTML + "; " + charsetUTF8 MIMETextPlain = "text/plain" MIMETextPlainCharsetUTF8 = MIMETextPlain + "; " + charsetUTF8 MIMEMultipartForm = "multipart/form-data" MIMEOctetStream = "application/octet-stream" )
Variables ¶
View Source
var ( TagMatched = []byte{1} TagNoMatched = []byte{0} )
View Source
var MatcherCounterMetric = tsdb.NewMatcherCounterStat()
View Source
var MetricCounterMetric = tsdb.NewMetricCounterStat()
View Source
var QueryCounterMetric = tsdb.NewQueryCounterStat()
Functions ¶
This section is empty.
Types ¶
type Datahub ¶
func NewDatahub ¶
func NewDatahub() *Datahub
func (*Datahub) GetDomainConfigData ¶
GetDomainConfigData 获取已加载的域名列表
func (*Datahub) GetDomainConfigOptions ¶
GetDomainConfigOptions 获取已加载的域名列表 vc v
func (*Datahub) GetKeywordConfigData ¶
GetKeywordConfigData 获取已加载的域名关键词列表
func (*Datahub) GetNetworksConfigData ¶
GetNetworksConfigData 获取已加载的地址列表
func (*Datahub) GetNetworksConfigOptions ¶
GetNetworksConfigOptions 获取已加载的地址列表
func (*Datahub) LoadGeoIPFromDAT ¶
LoadGeoIPFromDAT 载入 GEOIP 数据表
func (*Datahub) LoadGeoSiteFromDAT ¶
LoadGeoSiteFromDAT 载入 GEOSITE 表
func (*Datahub) MatchGeosite ¶
MatchGeosite 匹配 Geosite 域名
func (*Datahub) MatchKeyword ¶
MatchKeyword 域名关键词匹配
func (*Datahub) MatchNetByStr ¶
MatchNetByStr 匹配自定义网络地址
func (*Datahub) MixMatchNet ¶
MixMatchNet 混合模式匹配网络地址
func (*Datahub) MixMatchNetByStr ¶
MixMatchNetByStr 混合模式匹配网络地址
func (*Datahub) MixMatchTags ¶
MixMatchTags 混合模式匹配域名
func (*Datahub) NotifyMessage ¶
func (*Datahub) OnShutdown ¶
Click to show internal directories.
Click to hide internal directories.