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-08-25 07:25:59 -04:00
|
|
|
config, name, err := configCache.Load(rawConfig)
|
|
|
|
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 07:52:16 -04:00
|
|
|
func init() {
|
|
|
|
configCache = loader.NewJSONConfigLoader(loader.ConfigCreatorCache{}, "type", "")
|
|
|
|
}
|