| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 | package pointimport (	"github.com/v2ray/v2ray-core/app/dns"	"github.com/v2ray/v2ray-core/app/router"	"github.com/v2ray/v2ray-core/common/log"	v2net "github.com/v2ray/v2ray-core/common/net"	"github.com/v2ray/v2ray-core/transport")type ConnectionConfig struct {	Protocol string	Settings []byte}type LogConfig struct {	AccessLog string	ErrorLog  string	LogLevel  log.LogLevel}const (	AllocationStrategyAlways   = "always"	AllocationStrategyRandom   = "random"	AllocationStrategyExternal = "external")type InboundDetourAllocationConfig struct {	Strategy    string // Allocation strategy of this inbound detour.	Concurrency int    // Number of handlers (ports) running in parallel.	Refresh     int    // Number of minutes before a handler is regenerated.}type InboundDetourConfig struct {	Protocol   string	PortRange  v2net.PortRange	ListenOn   v2net.Address	Tag        string	Allocation *InboundDetourAllocationConfig	Settings   []byte}type OutboundDetourConfig struct {	Protocol string	Tag      string	Settings []byte}type Config struct {	Port            v2net.Port	ListenOn        v2net.Address	LogConfig       *LogConfig	RouterConfig    *router.Config	DNSConfig       *dns.Config	InboundConfig   *ConnectionConfig	OutboundConfig  *ConnectionConfig	InboundDetours  []*InboundDetourConfig	OutboundDetours []*OutboundDetourConfig	TransportConfig *transport.Config}type ConfigLoader func(init string) (*Config, error)var (	configLoader ConfigLoader)func LoadConfig(init string) (*Config, error) {	if configLoader == nil {		return nil, ErrorBadConfiguration	}	return configLoader(init)}
 |