distribution

package
v0.14.7 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2023 License: GPL-3.0 Imports: 10 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,
	defaultInterfaceName string,
) (Config, error)

func (Config) ConnMatcher added in v0.13.0

func (c Config) ConnMatcher(metadata *C.Metadata, prevRule constants.RuleType) (constants.RuleType, error)

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,
	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) ConnMatcher added in v0.13.0

func (c SystemProxyConfig) ConnMatcher(metadata *C.Metadata, prevRule constants.RuleType) (constants.RuleType, error)

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