mirror of https://github.com/v2ray/v2ray-core
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
385 B
17 lines
385 B
7 years ago
|
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)
|
||
|
}
|