2015-12-06 15:41:41 +00:00
|
|
|
package point
|
2015-10-06 21:11:08 +00:00
|
|
|
|
2015-11-21 20:43:40 +00:00
|
|
|
import (
|
2015-12-06 10:00:10 +00:00
|
|
|
"github.com/v2ray/v2ray-core/app/dns"
|
2015-12-07 21:47:47 +00:00
|
|
|
"github.com/v2ray/v2ray-core/app/router"
|
2015-12-05 20:10:14 +00:00
|
|
|
"github.com/v2ray/v2ray-core/common/log"
|
2015-11-21 20:43:40 +00:00
|
|
|
v2net "github.com/v2ray/v2ray-core/common/net"
|
|
|
|
)
|
|
|
|
|
2015-09-19 13:07:10 +00:00
|
|
|
type ConnectionConfig interface {
|
2015-09-19 13:35:20 +00:00
|
|
|
Protocol() string
|
2015-10-29 22:35:54 +00:00
|
|
|
Settings() interface{}
|
2015-09-12 20:11:54 +00:00
|
|
|
}
|
|
|
|
|
2015-10-09 15:43:27 +00:00
|
|
|
type LogConfig interface {
|
|
|
|
AccessLog() string
|
2015-12-05 20:10:14 +00:00
|
|
|
ErrorLog() string
|
|
|
|
LogLevel() log.LogLevel
|
2015-10-09 15:43:27 +00:00
|
|
|
}
|
|
|
|
|
2015-12-06 10:00:10 +00:00
|
|
|
type DnsConfig interface {
|
|
|
|
Enabled() bool
|
|
|
|
Settings() dns.CacheConfig
|
|
|
|
}
|
|
|
|
|
2015-12-28 22:17:38 +00:00
|
|
|
const (
|
|
|
|
AllocationStrategyAlways = "always"
|
|
|
|
AllocationStrategyRandom = "random"
|
|
|
|
AllocationStrategyExternal = "external"
|
|
|
|
)
|
|
|
|
|
|
|
|
type InboundDetourAllocationConfig interface {
|
2015-12-29 19:52:35 +00:00
|
|
|
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.
|
2015-12-28 22:17:38 +00:00
|
|
|
}
|
|
|
|
|
2015-10-31 21:22:43 +00:00
|
|
|
type InboundDetourConfig interface {
|
2015-10-31 13:08:13 +00:00
|
|
|
Protocol() string
|
2015-11-21 20:43:40 +00:00
|
|
|
PortRange() v2net.PortRange
|
2015-12-07 23:54:45 +00:00
|
|
|
Tag() string
|
2015-12-28 22:17:38 +00:00
|
|
|
Allocation() InboundDetourAllocationConfig
|
2015-10-31 21:22:43 +00:00
|
|
|
Settings() interface{}
|
2015-10-31 13:08:13 +00:00
|
|
|
}
|
|
|
|
|
2015-11-13 22:43:58 +00:00
|
|
|
type OutboundDetourConfig interface {
|
|
|
|
Protocol() string
|
2015-11-30 15:14:38 +00:00
|
|
|
Tag() string
|
2015-11-13 22:43:58 +00:00
|
|
|
Settings() interface{}
|
|
|
|
}
|
|
|
|
|
2015-09-19 13:07:10 +00:00
|
|
|
type PointConfig interface {
|
2015-12-02 20:44:01 +00:00
|
|
|
Port() v2net.Port
|
2015-10-09 15:43:27 +00:00
|
|
|
LogConfig() LogConfig
|
2015-12-07 23:04:02 +00:00
|
|
|
RouterConfig() router.Config
|
2015-09-19 13:35:20 +00:00
|
|
|
InboundConfig() ConnectionConfig
|
|
|
|
OutboundConfig() ConnectionConfig
|
2015-10-31 21:22:43 +00:00
|
|
|
InboundDetours() []InboundDetourConfig
|
2015-11-22 16:41:52 +00:00
|
|
|
OutboundDetours() []OutboundDetourConfig
|
2015-09-12 20:11:54 +00:00
|
|
|
}
|