mirror of
https://github.com/v2ray/v2ray-core.git
synced 2026-11-19 23:03:08 +00:00
completely remove json folder in v2ray
This commit is contained in:
1 parent
9af80c834b
commit
dde47290d7
19 files changed
+391
-587
No files matched your search
+45
-32
@@ -7,20 +7,20 @@ import (
|
||||
v2net "github.com/v2ray/v2ray-core/common/net"
|
||||
)
|
||||
|
||||
type ConnectionConfig interface {
|
||||
Protocol() string
|
||||
Settings() []byte
|
||||
type ConnectionConfig struct {
|
||||
Protocol string
|
||||
Settings []byte
|
||||
}
|
||||
|
||||
type LogConfig interface {
|
||||
AccessLog() string
|
||||
ErrorLog() string
|
||||
LogLevel() log.LogLevel
|
||||
type LogConfig struct {
|
||||
AccessLog string
|
||||
ErrorLog string
|
||||
LogLevel log.LogLevel
|
||||
}
|
||||
|
||||
type DnsConfig interface {
|
||||
Enabled() bool
|
||||
Settings() dns.CacheConfig
|
||||
type DnsConfig struct {
|
||||
Enabled bool
|
||||
Settings *dns.CacheConfig
|
||||
}
|
||||
|
||||
const (
|
||||
@@ -29,32 +29,45 @@ const (
|
||||
AllocationStrategyExternal = "external"
|
||||
)
|
||||
|
||||
type InboundDetourAllocationConfig interface {
|
||||
Strategy() string // Allocation strategy of this inbound detour.
|
||||
Concurrency() int // Number of handlers (ports) running in parallel.
|
||||
Refresh() int // Number of seconds before a handler is regenerated.
|
||||
type InboundDetourAllocationConfig struct {
|
||||
Strategy string // Allocation strategy of this inbound detour.
|
||||
Concurrency int // Number of handlers (ports) running in parallel.
|
||||
Refresh int // Number of seconds before a handler is regenerated.
|
||||
}
|
||||
|
||||
type InboundDetourConfig interface {
|
||||
Protocol() string
|
||||
PortRange() v2net.PortRange
|
||||
Tag() string
|
||||
Allocation() InboundDetourAllocationConfig
|
||||
Settings() []byte
|
||||
type InboundDetourConfig struct {
|
||||
Protocol string
|
||||
PortRange v2net.PortRange
|
||||
Tag string
|
||||
Allocation *InboundDetourAllocationConfig
|
||||
Settings []byte
|
||||
}
|
||||
|
||||
type OutboundDetourConfig interface {
|
||||
Protocol() string
|
||||
Tag() string
|
||||
Settings() []byte
|
||||
type OutboundDetourConfig struct {
|
||||
Protocol string
|
||||
Tag string
|
||||
Settings []byte
|
||||
}
|
||||
|
||||
type PointConfig interface {
|
||||
Port() v2net.Port
|
||||
LogConfig() LogConfig
|
||||
RouterConfig() *router.Config
|
||||
InboundConfig() ConnectionConfig
|
||||
OutboundConfig() ConnectionConfig
|
||||
InboundDetours() []InboundDetourConfig
|
||||
OutboundDetours() []OutboundDetourConfig
|
||||
type Config struct {
|
||||
Port v2net.Port
|
||||
LogConfig *LogConfig
|
||||
RouterConfig *router.Config
|
||||
InboundConfig *ConnectionConfig
|
||||
OutboundConfig *ConnectionConfig
|
||||
InboundDetours []*InboundDetourConfig
|
||||
OutboundDetours []*OutboundDetourConfig
|
||||
}
|
||||
|
||||
type ConfigLoader func(init string) (*Config, error)
|
||||
|
||||
var (
|
||||
configLoader ConfigLoader
|
||||
)
|
||||
|
||||
func LoadConfig(init string) (*Config, error) {
|
||||
if configLoader == nil {
|
||||
return nil, BadConfiguration
|
||||
}
|
||||
return configLoader(init)
|
||||
}
|
||||
Reference in new issue
Block a user