-
Notifications
You must be signed in to change notification settings - Fork 7
/
types.go
65 lines (55 loc) · 982 Bytes
/
types.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
package main
import (
"time"
)
type ConfigInfo struct {
FileName *string
Size int64
ModTime time.Time
Debug *bool
Version *bool
}
type ProxyServer struct {
ServerList []*ForwardServer
}
type HtmlData struct {
Title string
Data map[string]string
ProxyStatus []Proxy
}
type HAConfig struct {
Configs Config
}
type Config struct {
ProxyList []Proxy
}
type Proxy struct {
Name string
Src string
SrcPort string
Mode string
Type string
KeepAlive int
CheckTime int
Counter int
DstLen int
Index int
DstList []DstConfig
}
type DstConfig struct {
Name string
Dst string
DstPort string
Weight int
WeightCounter int
Check bool
Health bool
Counter int
Connections int
}
func (p *Proxy) GetSrcAddr() string {
return p.Src + ":" + p.SrcPort
}
func (p *Proxy) GetDstAddr(index int) string {
return p.DstList[index].Dst + ":" + p.DstList[index].DstPort
}