config.go 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. package point
  2. import (
  3. "github.com/v2ray/v2ray-core/app/dns"
  4. "github.com/v2ray/v2ray-core/app/router"
  5. "github.com/v2ray/v2ray-core/common/log"
  6. v2net "github.com/v2ray/v2ray-core/common/net"
  7. )
  8. type ConnectionConfig interface {
  9. Protocol() string
  10. Settings() interface{}
  11. }
  12. type LogConfig interface {
  13. AccessLog() string
  14. ErrorLog() string
  15. LogLevel() log.LogLevel
  16. }
  17. type DnsConfig interface {
  18. Enabled() bool
  19. Settings() dns.CacheConfig
  20. }
  21. const (
  22. AllocationStrategyAlways = "always"
  23. AllocationStrategyRandom = "random"
  24. AllocationStrategyExternal = "external"
  25. )
  26. type InboundDetourAllocationConfig interface {
  27. Strategy() string
  28. Concurrency() int
  29. }
  30. type InboundDetourConfig interface {
  31. Protocol() string
  32. PortRange() v2net.PortRange
  33. Tag() string
  34. Allocation() InboundDetourAllocationConfig
  35. Settings() interface{}
  36. }
  37. type OutboundDetourConfig interface {
  38. Protocol() string
  39. Tag() string
  40. Settings() interface{}
  41. }
  42. type PointConfig interface {
  43. Port() v2net.Port
  44. LogConfig() LogConfig
  45. RouterConfig() router.Config
  46. InboundConfig() ConnectionConfig
  47. OutboundConfig() ConnectionConfig
  48. InboundDetours() []InboundDetourConfig
  49. OutboundDetours() []OutboundDetourConfig
  50. }