route.go 1.9 KB

123456789101112131415161718192021222324252627282930313233
  1. package option
  2. import "github.com/sagernet/sing/common/json/badoption"
  3. type RouteOptions struct {
  4. GeoIP *GeoIPOptions `json:"geoip,omitempty"`
  5. Geosite *GeositeOptions `json:"geosite,omitempty"`
  6. Rules []Rule `json:"rules,omitempty"`
  7. RuleSet []RuleSet `json:"rule_set,omitempty"`
  8. Final string `json:"final,omitempty"`
  9. FindProcess bool `json:"find_process,omitempty"`
  10. AutoDetectInterface bool `json:"auto_detect_interface,omitempty"`
  11. OverrideAndroidVPN bool `json:"override_android_vpn,omitempty"`
  12. DefaultInterface string `json:"default_interface,omitempty"`
  13. DefaultMark FwMark `json:"default_mark,omitempty"`
  14. DefaultDomainResolver *DomainResolveOptions `json:"default_domain_resolver,omitempty"`
  15. DefaultNetworkStrategy *NetworkStrategy `json:"default_network_strategy,omitempty"`
  16. DefaultNetworkType badoption.Listable[InterfaceType] `json:"default_network_type,omitempty"`
  17. DefaultFallbackNetworkType badoption.Listable[InterfaceType] `json:"default_fallback_network_type,omitempty"`
  18. DefaultFallbackDelay badoption.Duration `json:"default_fallback_delay,omitempty"`
  19. }
  20. type GeoIPOptions struct {
  21. Path string `json:"path,omitempty"`
  22. DownloadURL string `json:"download_url,omitempty"`
  23. DownloadDetour string `json:"download_detour,omitempty"`
  24. }
  25. type GeositeOptions struct {
  26. Path string `json:"path,omitempty"`
  27. DownloadURL string `json:"download_url,omitempty"`
  28. DownloadDetour string `json:"download_detour,omitempty"`
  29. }