示例#1
0
func NewCache(config *CacheConfig) *DnsCache {
	cache := &DnsCache{
		cache:  collect.NewValidityMap(3600),
		config: config,
	}
	return cache
}
示例#2
0
func NewRouter(config *RouterRuleConfig) *Router {
	return &Router{
		config: config,
		cache:  collect.NewValidityMap(3600),
	}
}
示例#3
0
func NewRouter() *Router {
	return &Router{
		rules: make([]*Rule, 0, 16),
		cache: collect.NewValidityMap(3600),
	}
}