distribution

package
v0.11.8 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2023 License: GPL-3.0 Imports: 9 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 NewTun added in v0.11.0

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

func (Config) GetConnRule added in v0.11.0

func (c Config) GetConnRule(metadata C.Metadata) constants.RuleType

func (Config) GetDnsType added in v0.11.0

func (c Config) GetDnsType(domain string) constants.DnsType

func (Config) GetDnsTypeFromRuleEngine added in v0.11.0

func (c Config) GetDnsTypeFromRuleEngine(domain string) (constants.DnsType, error)

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
	Client  cResolver.Resolver
}

type SystemProxyConfig added in v0.11.0

type SystemProxyConfig struct {
	RuleEngine *ruleEngine.Engine
}

func NewSystemProxy added in v0.11.0

func NewSystemProxy(
	ruleId string,
	rules []string,
) (SystemProxyConfig, error)

func (SystemProxyConfig) GetConnRule added in v0.11.0

func (c SystemProxyConfig) GetConnRule(metadata C.Metadata) constants.RuleType

func (SystemProxyConfig) GetDnsType added in v0.11.0

func (c SystemProxyConfig) GetDnsType(domain string) constants.DnsType

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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