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:
16
config.go
16
config.go
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user