2016-08-06 15:59:22 -04:00
|
|
|
// +build json
|
|
|
|
|
|
|
|
package internet
|
|
|
|
|
2016-08-25 07:25:59 -04:00
|
|
|
import (
|
|
|
|
"v2ray.com/core/common/loader"
|
|
|
|
)
|
2016-08-06 15:59:22 -04:00
|
|
|
|
2016-09-21 07:52:16 -04:00
|
|
|
func CreateAuthenticatorConfig(rawConfig []byte) (string, interface{}, error) {
|
2016-09-21 08:39:07 -04:00
|
|
|
config, name, err := configLoader.Load(rawConfig)
|
2016-08-25 07:25:59 -04:00
|
|
|
if err != nil {
|
|
|
|
return name, nil, err
|
|
|
|
}
|
|
|
|
return name, config, nil
|
2016-08-06 15:59:22 -04:00
|
|
|
}
|
2016-08-25 07:25:59 -04:00
|
|
|
|
2016-09-21 08:39:07 -04:00
|
|
|
var (
|
2016-10-03 06:25:36 -04:00
|
|
|
configLoader loader.ConfigLoader
|
2016-09-21 08:39:07 -04:00
|
|
|
)
|
2016-10-03 06:25:36 -04:00
|
|
|
|
|
|
|
func init() {
|
|
|
|
configLoader = loader.NewJSONConfigLoader(configCache, "type", "")
|
|
|
|
}
|