v2ray-core/transport/internet/authenticator_json.go

20 lines
374 B
Go
Raw Normal View History

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