1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-10-02 16:56:02 -04:00
v2fly/main/confloader/confloader.go

20 lines
317 B
Go
Raw Normal View History

2019-12-15 20:33:41 -05:00
package confloader
import (
"io"
"os"
)
2020-01-01 12:23:56 -05:00
type configFileLoader func(string) (io.ReadCloser, error)
2019-12-15 20:33:41 -05:00
var (
EffectiveConfigFileLoader configFileLoader
)
2020-01-01 12:23:56 -05:00
func LoadConfig(file string) (io.ReadCloser, error) {
2019-12-15 20:33:41 -05:00
if EffectiveConfigFileLoader == nil {
return os.Stdin, nil
}
return EffectiveConfigFileLoader(file)
}