mirror of
https://gitclone.com/github.com/MetaCubeX/Clash.Meta
synced 2025-05-13 05:28:16 +08:00
chore: add some fields for override
This commit is contained in:
parent
23e3f12e88
commit
6399347a63
@ -36,6 +36,8 @@ type OverrideSchema struct {
|
|||||||
Interface *string `provider:"interface-name,omitempty"`
|
Interface *string `provider:"interface-name,omitempty"`
|
||||||
RoutingMark *int `provider:"routing-mark,omitempty"`
|
RoutingMark *int `provider:"routing-mark,omitempty"`
|
||||||
IPVersion *string `provider:"ip-version,omitempty"`
|
IPVersion *string `provider:"ip-version,omitempty"`
|
||||||
|
AdditionalPrefix *string `provider:"additional-prefix,omitempty"`
|
||||||
|
AdditionalSuffix *string `provider:"additional-suffix,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type proxyProviderSchema struct {
|
type proxyProviderSchema struct {
|
||||||
|
@ -399,6 +399,14 @@ func proxiesParseAndFilter(filter string, excludeFilter string, excludeTypeArray
|
|||||||
if override.IPVersion != nil {
|
if override.IPVersion != nil {
|
||||||
mapping["ip-version"] = *override.IPVersion
|
mapping["ip-version"] = *override.IPVersion
|
||||||
}
|
}
|
||||||
|
if override.AdditionalPrefix != nil {
|
||||||
|
name := mapping["name"].(string)
|
||||||
|
mapping["name"] = *override.AdditionalPrefix + name
|
||||||
|
}
|
||||||
|
if override.AdditionalSuffix != nil {
|
||||||
|
name := mapping["name"].(string)
|
||||||
|
mapping["name"] = name + *override.AdditionalSuffix
|
||||||
|
}
|
||||||
|
|
||||||
proxy, err := adapter.ParseProxy(mapping)
|
proxy, err := adapter.ParseProxy(mapping)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -862,6 +862,8 @@ proxy-providers:
|
|||||||
# interface-name: tailscale0
|
# interface-name: tailscale0
|
||||||
# routing-mark: 233
|
# routing-mark: 233
|
||||||
# ip-version: ipv4-prefer
|
# ip-version: ipv4-prefer
|
||||||
|
# additional-prefix: "[provider1]"
|
||||||
|
# additional-suffix: "test"
|
||||||
test:
|
test:
|
||||||
type: file
|
type: file
|
||||||
path: /test.yaml
|
path: /test.yaml
|
||||||
|
Loading…
Reference in New Issue
Block a user