-
Notifications
You must be signed in to change notification settings - Fork 3
/
ports.go
49 lines (40 loc) · 1.13 KB
/
ports.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package core
type DnsConfigurer interface {
// check if given IP is the active DNS server in /etc/resolve.conf and update if needed
ActivateDnsServer(dnsServerIp string)
// Ensure that in /etc/wsl.conf 'generateResolvConf' is set to 'false'
// Creates /etc/wsl.conf if not exists
DisableResolveAutoConfGeneration()
}
type EnvVarPrinter interface {
PrintExportCommands()
PrintUnsetCommands()
WarnIfProxyVarSet()
}
type LinuxPinger interface {
Ping(host string) bool
}
type LinuxConfigurer interface {
SetP2pInterface()
DeleteDefaultGateway()
AddDefaultGateway()
}
type WindowsChecker interface {
IsPingable(host string) bool
IsPxProxyRunning() bool
IsRunningOnWsl2() bool
}
type WindowsConfigurer interface {
Init() // deferred construction and object setup,
Cleanup() // cleanup temporary resources
AddP2pAddress(successChecker func() bool) error
SetPortProxy(successChecker func() bool) error
}
type HttpChecker interface {
HasDirectInternetAccess(timeoutInMilliseconds ...int) bool
HasInternetAccessViaProxy(timeoutInMilliseconds ...int) bool
IsPxProxyReachable() bool
}
type NetworkConfigurer interface {
Configure() error
}