-
Notifications
You must be signed in to change notification settings - Fork 0
/
struct.go
106 lines (89 loc) · 2.8 KB
/
struct.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
package main
type Config struct {
Log Log `json:"log"`
API API `json:"api"`
Inbounds []Inbound `json:"inbounds"`
Outbounds []Outbound `json:"outbounds"`
Policy Policy `json:"policy"`
Routing Routing `json:"routing"`
Stats map[string]interface{} `json:"stats"`
}
type Log struct {
Access string `json:"access"`
DNSLog bool `json:"dnsLog"`
Error string `json:"error"`
Loglevel string `json:"loglevel"`
}
type API struct {
Tag string `json:"tag"`
Services []string `json:"services"`
}
type Inbound struct {
Tag string `json:"tag"`
Listen *string `json:"listen"`
Port int `json:"port"`
Protocol string `json:"protocol"`
Settings map[string]interface{} `json:"settings"`
StreamSettings *StreamSettings `json:"streamSettings"`
Sniffing *Sniffing `json:"sniffing"`
}
type Outbound struct {
Tag string `json:"tag"`
Protocol string `json:"protocol"`
Settings OutboundSettings `json:"settings"`
StreamSettings *StreamSettings `json:"streamSettings"`
}
type OutboundSettings struct {
Servers []Server `json:"servers"`
}
type Server struct {
Address string `json:"address"`
Port int `json:"port"`
Password string `json:"password"`
}
type StreamSettings struct {
Network string `json:"network"`
Security string `json:"security"`
TLSSettings *TLSSettings `json:"tlsSettings"`
TCPSettings *TCPSettings `json:"tcpSettings"`
}
type TLSSettings struct {
ServerName string `json:"serverName"`
ALPN []string `json:"alpn"`
Fingerprint string `json:"fingerprint"`
AllowInsecure bool `json:"allowInsecure"`
}
type TCPSettings struct {
Header Header `json:"header"`
}
type Header struct {
Type string `json:"type"`
}
type Sniffing struct {
// Define fields if needed
}
type Policy struct {
Levels map[string]Level `json:"levels"`
System System `json:"system"`
}
type Level struct {
StatsUserDownlink bool `json:"statsUserDownlink"`
StatsUserUplink bool `json:"statsUserUplink"`
}
type System struct {
StatsInboundDownlink bool `json:"statsInboundDownlink"`
StatsInboundUplink bool `json:"statsInboundUplink"`
StatsOutboundDownlink bool `json:"statsOutboundDownlink"`
StatsOutboundUplink bool `json:"statsOutboundUplink"`
}
type Routing struct {
DomainStrategy string `json:"domainStrategy"`
Rules []Rule `json:"rules"`
}
type Rule struct {
Type string `json:"type"`
InboundTag []string `json:"inboundTag"`
OutboundTag string `json:"outboundTag"`
IP []string `json:"ip"`
Protocol []string `json:"protocol"`
}