1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-11-17 09:56:18 -05:00
v2fly/functions.go

21 lines
617 B
Go
Raw Normal View History

2018-05-31 05:55:11 -04:00
package core
import (
"context"
"v2ray.com/core/common"
)
// CreateObject creates a new object based on the given V2Ray instance and config. The V2Ray instance may be nil.
func CreateObject(v *Instance, config interface{}) (interface{}, error) {
ctx := context.Background()
if v != nil {
ctx = context.WithValue(ctx, v2rayKey, v)
}
return common.CreateObject(ctx, config)
}
2018-09-21 10:54:06 -04:00
func PrintDeprecatedFeatureWarning(feature string) {
2018-10-04 15:14:59 -04:00
newError("You are using a deprecated feature: " + feature + ". Please update your config file with latest configuration format, or update your client software.").WriteToLog()
2018-09-21 10:54:06 -04:00
}