datahub

package
v0.0.0-...-406c194 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 10, 2022 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Index

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

type Datahub struct {

	//
	Next plugin.Handler
	// contains filtered or unexported fields
}

func NewDatahub

func NewDatahub() *Datahub

func (*Datahub) GetDomainConfigData

func (dh *Datahub) GetDomainConfigData() []map[string]interface{}

GetDomainConfigData 获取已加载的域名列表

func (*Datahub) GetDomainConfigOptions

func (dh *Datahub) GetDomainConfigOptions() []string

GetDomainConfigOptions 获取已加载的域名列表 vc v

func (*Datahub) GetKeywordConfigData

func (dh *Datahub) GetKeywordConfigData() []map[string]interface{}

GetKeywordConfigData 获取已加载的域名关键词列表

func (*Datahub) GetNetworksConfigData

func (dh *Datahub) GetNetworksConfigData() []map[string]interface{}

GetNetworksConfigData 获取已加载的地址列表

func (*Datahub) GetNetworksConfigOptions

func (dh *Datahub) GetNetworksConfigOptions() []string

GetNetworksConfigOptions 获取已加载的地址列表

func (*Datahub) LoadGeoIPFromDAT

func (dh *Datahub) LoadGeoIPFromDAT(tag string) (*v2data.GeoIP, error)

LoadGeoIPFromDAT 载入 GEOIP 数据表

func (*Datahub) LoadGeoSiteFromDAT

func (dh *Datahub) LoadGeoSiteFromDAT(country string) (*v2data.GeoSite, error)

LoadGeoSiteFromDAT 载入 GEOSITE 表

func (*Datahub) MatchEcs

func (dh *Datahub) MatchEcs(tag string, client string) net.IP

MatchEcs 匹配 ECS IP

func (*Datahub) MatchGeoNet

func (dh *Datahub) MatchGeoNet(tag string, net iplib.Net) bool

func (*Datahub) MatchGeoip

func (dh *Datahub) MatchGeoip(tag string, ip net.IP) bool

func (*Datahub) MatchGeosite

func (dh *Datahub) MatchGeosite(matchType, tag string, name string) bool

MatchGeosite 匹配 Geosite 域名

func (*Datahub) MatchKeyword

func (dh *Datahub) MatchKeyword(tag string, name string) bool

MatchKeyword 域名关键词匹配

func (*Datahub) MatchNet

func (dh *Datahub) MatchNet(tag string, ns iplib.Net) bool

MatchNet 匹配自定义网络地址

func (*Datahub) MatchNetByStr

func (dh *Datahub) MatchNetByStr(tag string, ns string) bool

MatchNetByStr 匹配自定义网络地址

func (*Datahub) MixMatch

func (dh *Datahub) MixMatch(tag string, name string) bool

MixMatch 混合模式匹配域名

func (*Datahub) MixMatchNet

func (dh *Datahub) MixMatchNet(tag string, ns iplib.Net) (bool, string)

MixMatchNet 混合模式匹配网络地址

func (*Datahub) MixMatchNetByStr

func (dh *Datahub) MixMatchNetByStr(tag string, ns string) (bool, string)

MixMatchNetByStr 混合模式匹配网络地址

func (*Datahub) MixMatchTags

func (dh *Datahub) MixMatchTags(tags []string, name string) (bool, string)

MixMatchTags 混合模式匹配域名

func (*Datahub) Name

func (dh *Datahub) Name() string

func (*Datahub) NotifyMessage

func (dh *Datahub) NotifyMessage(topic string, state *request.Request)

func (*Datahub) OnShutdown

func (dh *Datahub) OnShutdown() error

func (*Datahub) OnStartup

func (dh *Datahub) OnStartup() error

func (*Datahub) Push

func (dh *Datahub) Push(dlog tsdb.MdnsLog)

func (*Datahub) ServeDNS

func (dh *Datahub) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (int, error)

func (*Datahub) Sid

func (dh *Datahub) Sid() string

func (*Datahub) ToDnstap

func (dh *Datahub) ToDnstap(host string, state *request.Request, reply *dns.Msg, start time.Time)

toDnstap will send the forward and received message to the dnstap plugin.

func (*Datahub) TsDB

func (dh *Datahub) TsDB() *tsdb.TsDB

type DnsNotify

type DnsNotify struct {
	Topic  string `json:"topic"`
	Client string `json:"client"`
	QName  string `json:"qname"`
	Class  string `json:"class"`
	QType  string `json:"qtype"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL