mirror of
				https://github.com/v2fly/v2ray-core.git
				synced 2025-11-04 11:49:16 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			17 lines
		
	
	
		
			385 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			17 lines
		
	
	
		
			385 B
		
	
	
	
		
			Go
		
	
	
	
	
	
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)
 | 
						|
}
 |