mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-12-22 18:17:52 -05:00
20 lines
317 B
Go
20 lines
317 B
Go
|
package confloader
|
||
|
|
||
|
import (
|
||
|
"io"
|
||
|
"os"
|
||
|
)
|
||
|
|
||
|
type configFileLoader func(string) (io.ReadCloser, error)
|
||
|
|
||
|
var (
|
||
|
EffectiveConfigFileLoader configFileLoader
|
||
|
)
|
||
|
|
||
|
func LoadConfig(file string) (io.ReadCloser, error) {
|
||
|
if EffectiveConfigFileLoader == nil {
|
||
|
return os.Stdin, nil
|
||
|
}
|
||
|
return EffectiveConfigFileLoader(file)
|
||
|
}
|