route.go 1.8 KB

1234567891011121314151617181920212223242526272829303132
  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. DefaultNetworkStrategy *NetworkStrategy `json:"default_network_strategy,omitempty"`
  15. DefaultNetworkType badoption.Listable[InterfaceType] `json:"default_network_type,omitempty"`
  16. DefaultFallbackNetworkType badoption.Listable[InterfaceType] `json:"default_fallback_network_type,omitempty"`
  17. DefaultFallbackDelay badoption.Duration `json:"default_fallback_delay,omitempty"`
  18. }
  19. type GeoIPOptions struct {
  20. Path string `json:"path,omitempty"`
  21. DownloadURL string `json:"download_url,omitempty"`
  22. DownloadDetour string `json:"download_detour,omitempty"`
  23. }
  24. type GeositeOptions struct {
  25. Path string `json:"path,omitempty"`
  26. DownloadURL string `json:"download_url,omitempty"`
  27. DownloadDetour string `json:"download_detour,omitempty"`
  28. }