v2ray-core/shell/point/config.go

61 lines
1.3 KiB
Go
Raw Normal View History

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