authenticator_json.go 374 B

12345678910111213141516171819
  1. // +build json
  2. package internet
  3. import (
  4. "v2ray.com/core/common/loader"
  5. )
  6. func CreateAuthenticatorConfig(rawConfig []byte) (string, interface{}, error) {
  7. config, name, err := configLoader.Load(rawConfig)
  8. if err != nil {
  9. return name, nil, err
  10. }
  11. return name, config, nil
  12. }
  13. var (
  14. configLoader = loader.NewJSONConfigLoader(loader.ConfigCreatorCache{}, "type", "")
  15. )