v2ray-core/config.go

41 lines
873 B
Go
Raw Normal View History

2016-10-12 16:46:02 +02:00
package core
2015-10-06 23:11:08 +02:00
2015-11-21 21:43:40 +01:00
import (
2016-10-16 00:46:08 +02:00
"v2ray.com/core/common"
2015-11-21 21:43:40 +01:00
)
2016-10-14 22:21:45 +02:00
func (this *AllocationStrategyConcurrency) GetValue() uint32 {
if this == nil {
return 3
}
return this.Value
2015-12-28 23:17:38 +01:00
}
2016-10-14 22:21:45 +02:00
func (this *AllocationStrategyRefresh) GetValue() uint32 {
if this == nil {
return 5
}
return this.Value
2015-10-31 14:08:13 +01:00
}
2016-10-14 22:21:45 +02:00
func (this *InboundConnectionConfig) GetAllocationStrategyValue() *AllocationStrategy {
if this.AllocationStrategy == nil {
return &AllocationStrategy{}
}
return this.AllocationStrategy
2015-11-13 23:43:58 +01:00
}
2016-10-14 22:21:45 +02:00
func (this *InboundConnectionConfig) GetTypedSettings() (interface{}, error) {
2016-10-16 00:46:08 +02:00
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()
2016-01-17 21:43:10 +01:00
}