Documentation
¶
Index ¶
- Constants
- func ApplyConfig(config IDNSConfig) error
- func ClearDNSCache()
- func CloseGeoDB() error
- func GeoLookUp(ip string) (countryCode string)
- func InitDNSCache()
- func InitGeoIP(dbFile string) error
- func Pop(h heap.Interface) interface{}
- func Push(h heap.Interface, x interface{})
- type Answer
- type CacheEntity
- type CacheManager
- type CachePool
- func (c *CachePool) Clear()
- func (c *CachePool) Head() *CacheEntity
- func (c *CachePool) Len() int
- func (c *CachePool) Less(i, j int) bool
- func (c *CachePool) Pop() interface{}
- func (c *CachePool) Push(x interface{})
- func (c *CachePool) Range(f func(data interface{}) (breaked bool)) interface{}
- func (c *CachePool) Swap(i, j int)
- type DNS
- type DNSConfig
- type IDNSConfig
Constants ¶
View Source
const ( DNSTypeStatic = "static" DNSTypeDirect = "direct" DNSTypeRemote = "remote" DNSTypeCache = "cache" MatchTypeDomainSuffix = "DOMAIN-SUFFIX" MatchTypeDomain = "DOMAIN" MatchTypeDomainKeyword = "DOMAIN-KEYWORD" MatchNone = "NONE" )
View Source
const CacheTTL = 10 * time.Minute
Variables ¶
This section is empty.
Functions ¶
func ApplyConfig ¶
func ApplyConfig(config IDNSConfig) error
func ClearDNSCache ¶
func ClearDNSCache()
func CloseGeoDB ¶
func CloseGeoDB() error
func InitDNSCache ¶
func InitDNSCache()
Types ¶
type Answer ¶
type Answer struct { MatchType string Domain string IPs []string Server string Port string Type string Country string Duration time.Duration }
func DNSCacheList ¶
func DNSCacheList() []*Answer
func ResolveDomainByCache ¶
resolve domain and through the DNS-Cache
type CacheEntity ¶
type CacheEntity struct {
// contains filtered or unexported fields
}
type CacheManager ¶
type CacheManager struct {
// contains filtered or unexported fields
}
func NewCacheManager ¶
func NewCacheManager() *CacheManager
func (*CacheManager) Clear ¶
func (c *CacheManager) Clear()
func (*CacheManager) Push ¶
func (c *CacheManager) Push(data interface{}, ttl time.Duration)
func (*CacheManager) Range ¶
func (c *CacheManager) Range(f func(data interface{}) (breaked bool)) interface{}
func (*CacheManager) Run ¶
func (c *CacheManager) Run()
func (*CacheManager) Stop ¶
func (c *CacheManager) Stop()
type CachePool ¶
func NewCachePool ¶
func NewCachePool() *CachePool
func (*CachePool) Head ¶
func (c *CachePool) Head() *CacheEntity
Click to show internal directories.
Click to hide internal directories.