forked from v2ray/v2ray-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.go
55 lines (47 loc) · 1.22 KB
/
config.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
package core
import (
"v2ray.com/core/common"
v2net "v2ray.com/core/common/net"
)
func (this *AllocationStrategyConcurrency) GetValue() uint32 {
if this == nil {
return 3
}
return this.Value
}
func (this *AllocationStrategyRefresh) GetValue() uint32 {
if this == nil {
return 5
}
return this.Value
}
func (this *InboundConnectionConfig) GetAllocationStrategyValue() *AllocationStrategy {
if this.AllocationStrategy == nil {
return &AllocationStrategy{}
}
return this.AllocationStrategy
}
func (this *InboundConnectionConfig) GetListenOnValue() v2net.Address {
if this.GetListenOn() == nil {
return v2net.AnyIP
}
return this.ListenOn.AsAddress()
}
func (this *InboundConnectionConfig) GetTypedSettings() (interface{}, error) {
if this.GetSettings() == nil {
return nil, common.ErrBadConfiguration
}
return this.GetSettings().GetInstance()
}
func (this *OutboundConnectionConfig) GetTypedSettings() (interface{}, error) {
if this.GetSettings() == nil {
return nil, common.ErrBadConfiguration
}
return this.GetSettings().GetInstance()
}
func (this *OutboundConnectionConfig) GetSendThroughValue() v2net.Address {
if this.GetSendThrough() == nil {
return v2net.AnyIP
}
return this.SendThrough.AsAddress()
}