route.go 2.2 KB

123456789101112131415161718192021222324252627282930313233343536
  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. FindNeighbor bool `json:"find_neighbor,omitempty"`
  11. DHCPLeaseFiles badoption.Listable[string] `json:"dhcp_lease_files,omitempty"`
  12. AutoDetectInterface bool `json:"auto_detect_interface,omitempty"`
  13. OverrideAndroidVPN bool `json:"override_android_vpn,omitempty"`
  14. DefaultInterface string `json:"default_interface,omitempty"`
  15. DefaultMark FwMark `json:"default_mark,omitempty"`
  16. DefaultDomainResolver *DomainResolveOptions `json:"default_domain_resolver,omitempty"`
  17. DefaultNetworkStrategy *NetworkStrategy `json:"default_network_strategy,omitempty"`
  18. DefaultNetworkType badoption.Listable[InterfaceType] `json:"default_network_type,omitempty"`
  19. DefaultFallbackNetworkType badoption.Listable[InterfaceType] `json:"default_fallback_network_type,omitempty"`
  20. DefaultFallbackDelay badoption.Duration `json:"default_fallback_delay,omitempty"`
  21. DefaultHTTPClient string `json:"default_http_client,omitempty"`
  22. }
  23. type GeoIPOptions struct {
  24. Path string `json:"path,omitempty"`
  25. DownloadURL string `json:"download_url,omitempty"`
  26. DownloadDetour string `json:"download_detour,omitempty"`
  27. }
  28. type GeositeOptions struct {
  29. Path string `json:"path,omitempty"`
  30. DownloadURL string `json:"download_url,omitempty"`
  31. DownloadDetour string `json:"download_detour,omitempty"`
  32. }