1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-11-02 09:17:55 -04:00
v2fly/transport/internet/authenticator_json.go

24 lines
409 B
Go
Raw Normal View History

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", "")
}