mirror of
https://github.com/nitezs/sub2clash.git
synced 2024-12-23 15:14:43 -05:00
Update proxy_group.go 增加对proxies group中icon字段的支持
This commit is contained in:
parent
916670cf68
commit
ff73da3a4c
@ -17,6 +17,7 @@ type ProxyGroup struct {
|
|||||||
Size int `yaml:"-"`
|
Size int `yaml:"-"`
|
||||||
DisableUDP bool `yaml:"disable-udp,omitempty"`
|
DisableUDP bool `yaml:"disable-udp,omitempty"`
|
||||||
Strategy string `yaml:"strategy,omitempty"`
|
Strategy string `yaml:"strategy,omitempty"`
|
||||||
|
Icon string `yaml:"icon,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type SelectProxyGroup struct {
|
type SelectProxyGroup struct {
|
||||||
@ -24,6 +25,7 @@ type SelectProxyGroup struct {
|
|||||||
Type string `yaml:"type,omitempty"`
|
Type string `yaml:"type,omitempty"`
|
||||||
Proxies []string `yaml:"proxies,omitempty"`
|
Proxies []string `yaml:"proxies,omitempty"`
|
||||||
DisableUDP bool `yaml:"disable-udp,omitempty"`
|
DisableUDP bool `yaml:"disable-udp,omitempty"`
|
||||||
|
Icon string `yaml:"icon,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type UrlTestProxyGroup struct {
|
type UrlTestProxyGroup struct {
|
||||||
@ -35,6 +37,7 @@ type UrlTestProxyGroup struct {
|
|||||||
Tolerance int `yaml:"tolerance,omitempty"`
|
Tolerance int `yaml:"tolerance,omitempty"`
|
||||||
Lazy bool `yaml:"lazy"`
|
Lazy bool `yaml:"lazy"`
|
||||||
DisableUDP bool `yaml:"disable-udp,omitempty"`
|
DisableUDP bool `yaml:"disable-udp,omitempty"`
|
||||||
|
Icon string `yaml:"icon,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type LoadBalanceProxyGroup struct {
|
type LoadBalanceProxyGroup struct {
|
||||||
@ -46,12 +49,14 @@ type LoadBalanceProxyGroup struct {
|
|||||||
Interval int `yaml:"interval,omitempty"`
|
Interval int `yaml:"interval,omitempty"`
|
||||||
Lazy bool `yaml:"lazy"`
|
Lazy bool `yaml:"lazy"`
|
||||||
Strategy string `yaml:"strategy,omitempty"`
|
Strategy string `yaml:"strategy,omitempty"`
|
||||||
|
Icon string `yaml:"icon,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type RelayProxyGroup struct {
|
type RelayProxyGroup struct {
|
||||||
Name string `yaml:"name,omitempty"`
|
Name string `yaml:"name,omitempty"`
|
||||||
Type string `yaml:"type,omitempty"`
|
Type string `yaml:"type,omitempty"`
|
||||||
Proxies []string `yaml:"proxies,omitempty"`
|
Proxies []string `yaml:"proxies,omitempty"`
|
||||||
|
Icon string `yaml:"icon,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p ProxyGroup) MarshalYAML() (interface{}, error) {
|
func (p ProxyGroup) MarshalYAML() (interface{}, error) {
|
||||||
@ -62,6 +67,7 @@ func (p ProxyGroup) MarshalYAML() (interface{}, error) {
|
|||||||
Type: p.Type,
|
Type: p.Type,
|
||||||
Proxies: p.Proxies,
|
Proxies: p.Proxies,
|
||||||
DisableUDP: p.DisableUDP,
|
DisableUDP: p.DisableUDP,
|
||||||
|
Icon: p.Icon,
|
||||||
}, nil
|
}, nil
|
||||||
case "url-test", "fallback":
|
case "url-test", "fallback":
|
||||||
return UrlTestProxyGroup{
|
return UrlTestProxyGroup{
|
||||||
@ -73,6 +79,7 @@ func (p ProxyGroup) MarshalYAML() (interface{}, error) {
|
|||||||
Tolerance: p.Tolerance,
|
Tolerance: p.Tolerance,
|
||||||
Lazy: p.Lazy,
|
Lazy: p.Lazy,
|
||||||
DisableUDP: p.DisableUDP,
|
DisableUDP: p.DisableUDP,
|
||||||
|
Icon: p.Icon,
|
||||||
}, nil
|
}, nil
|
||||||
case "load-balance":
|
case "load-balance":
|
||||||
return LoadBalanceProxyGroup{
|
return LoadBalanceProxyGroup{
|
||||||
@ -84,18 +91,21 @@ func (p ProxyGroup) MarshalYAML() (interface{}, error) {
|
|||||||
Interval: p.Interval,
|
Interval: p.Interval,
|
||||||
Lazy: p.Lazy,
|
Lazy: p.Lazy,
|
||||||
Strategy: p.Strategy,
|
Strategy: p.Strategy,
|
||||||
|
Icon: p.Icon,
|
||||||
}, nil
|
}, nil
|
||||||
case "relay":
|
case "relay":
|
||||||
return RelayProxyGroup{
|
return RelayProxyGroup{
|
||||||
Name: p.Name,
|
Name: p.Name,
|
||||||
Type: p.Type,
|
Type: p.Type,
|
||||||
Proxies: p.Proxies,
|
Proxies: p.Proxies,
|
||||||
|
Icon: p.Icon,
|
||||||
}, nil
|
}, nil
|
||||||
default:
|
default:
|
||||||
return SelectProxyGroup{
|
return SelectProxyGroup{
|
||||||
Name: p.Name,
|
Name: p.Name,
|
||||||
Type: p.Type,
|
Type: p.Type,
|
||||||
Proxies: p.Proxies,
|
Proxies: p.Proxies,
|
||||||
|
Icon: p.Icon,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user