distribution

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2023 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddCachedDnsItem

func AddCachedDnsItem(ip, domain string, rule constants.DnsType)

func GetCachedDnsItem

func GetCachedDnsItem(ip string) (string, constants.DnsType, bool)

func ResetCache added in v0.9.2

func ResetCache()

Types

type Config

type Config struct {
	Dns        DnsDistribution
	RuleEngine *ruleEngine.Engine
}

func New

func New(
	boostDns string,
	remoteDns string,
	localDns string,
	ruleId string,
	rules []string,
	tunInterfaceName string,
	defaultInterfaceName string,
) (Config, error)

func (Config) GetDns

func (c Config) GetDns(domain string) SubDnsDistribution

func (Config) GetDnsRule

func (c Config) GetDnsRule(ip string) (constants.RuleType, error)

func (Config) GetDnsServerRule

func (c Config) GetDnsServerRule(ip string) (constants.RuleType, error)

func (Config) GetRule

func (c Config) GetRule(ip string) constants.RuleType

type DnsDistribution

type DnsDistribution struct {
	Local  SubDnsDistribution
	Remote SubDnsDistribution
	Boost  SubDnsDistribution
}

func NewDnsDistribution

func NewDnsDistribution(
	bootDns string,
	remoteDns string,
	localDns string,
	tunInterfaceName string,
	defaultInterfaceName string,
) (DnsDistribution, error)

type SubDnsDistribution

type SubDnsDistribution struct {
	Address string
	Type    constants.DnsType
	Client  cResolver.Resolver
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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