1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-30 05:56:54 -05:00

register implementation automatically

This commit is contained in:
Shelikhoo 2021-09-04 20:05:17 +01:00
parent 947166173a
commit 4d3c57dd39
No known key found for this signature in database
GPG Key ID: C4D5E79D22B25316

View File

@ -2,6 +2,7 @@ package common
import (
"context"
"github.com/v2fly/v2ray-core/v4/common/registry"
"reflect"
)
@ -17,6 +18,8 @@ func RegisterConfig(config interface{}, configCreator ConfigCreator) error {
return newError(configType.Name() + " is already registered").AtError()
}
typeCreatorRegistry[configType] = configCreator
registry.RegisterImplementation(config, nil)
return nil
}