forked from kevwan/tproxy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsettings.go
More file actions
34 lines (31 loc) · 692 Bytes
/
settings.go
File metadata and controls
34 lines (31 loc) · 692 Bytes
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
package main
import "time"
type Settings struct {
Remote string
LocalHost string
LocalPort int
Delay time.Duration
Protocol string
Stat bool
Quiet bool
UpLimit int64
DownLimit int64
}
func saveSettings(localHost string, localPort int, remote string, delay time.Duration,
protocol string, stat, quiet bool, upLimit, downLimit int64) {
if localHost != "" {
settings.LocalHost = localHost
}
if localPort != 0 {
settings.LocalPort = localPort
}
if remote != "" {
settings.Remote = remote
}
settings.Delay = delay
settings.Protocol = protocol
settings.Stat = stat
settings.Quiet = quiet
settings.UpLimit = upLimit
settings.DownLimit = downLimit
}