distribution

package
v1.7.3 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2024 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,
	defaultInterfaceName string,
	disableCache bool,
) (Config, error)

func (Config) ConnMatcher added in v0.13.0

func (c Config) ConnMatcher(metadata *C.Metadata, prevRule ruleEngine.Rule) (ruleEngine.Rule, error)

func (Config) GetDnsType added in v0.11.0

func (c Config) GetDnsType(domain string, metadata *C.Metadata) (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,
	disableCache bool,
) (DnsDistribution, error)

type SubDnsDistribution

type SubDnsDistribution struct {
	Addresses []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 ruleEngine.Rule) (ruleEngine.Rule, error)

func (SystemProxyConfig) GetDnsType added in v0.11.0

func (c SystemProxyConfig) GetDnsType(domain string, _ *C.Metadata) (constants.DnsType, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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