From cf6908fdf84b668b7ac936cd6348e94df26ad6bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Mon, 22 Apr 2024 21:09:31 +0800 Subject: [PATCH] Rename `subscription.process.[filter/exclude]_outbound_type` to `subscription.process.[filter/exclude]_type` --- docs/configuration/subscription.md | 8 ++++---- option/options.go | 14 +++++++------- subscription/process.go | 8 ++++---- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/docs/configuration/subscription.md b/docs/configuration/subscription.md index fb4f6b1..23f4dd4 100644 --- a/docs/configuration/subscription.md +++ b/docs/configuration/subscription.md @@ -9,8 +9,8 @@ { "filter": [], "exclude": [], - "filter_outbound_type": [], - "exclude_outbound_type": [], + "filter_type": [], + "exclude_type": [], "rename": {}, "remove_emoji": false, "rewrite_multiplex": {} @@ -62,11 +62,11 @@ Regexp filter rules, non-matching outbounds will be removed. Regexp exclude rules, matching outbounds will be removed. -#### process.filter_outbound_type +#### process.filter_type Outbound type filter rules, non-matching outbounds will be removed. -#### process.exclude_outbound_type +#### process.exclude_type Outbound type exclude rules, matching outbounds will be removed. diff --git a/option/options.go b/option/options.go index d0c2c91..7feb53f 100644 --- a/option/options.go +++ b/option/options.go @@ -62,13 +62,13 @@ type Subscription struct { } type OutboundProcessOptions struct { - Filter option.Listable[string] `json:"filter,omitempty"` - Exclude option.Listable[string] `json:"exclude,omitempty"` - FilterOutboundType option.Listable[string] `json:"filter_outbound_type,omitempty"` - ExcludeOutboundType option.Listable[string] `json:"exclude_outbound_type,omitempty"` - Rename *badjson.TypedMap[string, string] `json:"rename,omitempty"` - RemoveEmoji bool `json:"remove_emoji,omitempty"` - RewriteMultiplex *option.OutboundMultiplexOptions `json:"rewrite_multiplex,omitempty"` + Filter option.Listable[string] `json:"filter,omitempty"` + Exclude option.Listable[string] `json:"exclude,omitempty"` + FilterType option.Listable[string] `json:"filter_type,omitempty"` + ExcludeType option.Listable[string] `json:"exclude_type,omitempty"` + Rename *badjson.TypedMap[string, string] `json:"rename,omitempty"` + RemoveEmoji bool `json:"remove_emoji,omitempty"` + RewriteMultiplex *option.OutboundMultiplexOptions `json:"rewrite_multiplex,omitempty"` } type Profile struct { diff --git a/subscription/process.go b/subscription/process.go index 54b4e38..f3edfd2 100644 --- a/subscription/process.go +++ b/subscription/process.go @@ -74,8 +74,8 @@ func (o *ProcessOptions) Process(outbounds []boxOption.Outbound) []boxOption.Out continue } } - if len(o.FilterOutboundType) > 0 { - if !common.Contains(o.FilterOutboundType, outbound.Type) { + if len(o.FilterType) > 0 { + if !common.Contains(o.FilterType, outbound.Type) { continue } } @@ -86,8 +86,8 @@ func (o *ProcessOptions) Process(outbounds []boxOption.Outbound) []boxOption.Out continue } } - if len(o.ExcludeOutboundType) > 0 { - if common.Contains(o.ExcludeOutboundType, outbound.Type) { + if len(o.ExcludeType) > 0 { + if common.Contains(o.ExcludeType, outbound.Type) { continue } }