1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-12-27 20:45:28 -05:00

config loader

This commit is contained in:
Darien Raymond
2016-10-14 23:41:41 +02:00
parent 84f660bbbc
commit 35a0ed6fb4
4 changed files with 111 additions and 63 deletions

View File

@@ -1,9 +1,6 @@
package core
import (
"io"
"v2ray.com/core/common"
"v2ray.com/core/proxy/registry"
)
@@ -31,16 +28,3 @@ func (this *InboundConnectionConfig) GetAllocationStrategyValue() *AllocationStr
func (this *InboundConnectionConfig) GetTypedSettings() (interface{}, error) {
return registry.MarshalInboundConfig(this.Protocol, this.Settings)
}
type ConfigLoader func(input io.Reader) (*Config, error)
var (
configLoader ConfigLoader
)
func LoadConfig(input io.Reader) (*Config, error) {
if configLoader == nil {
return nil, common.ErrBadConfiguration
}
return configLoader(input)
}