字串比對器 (proto)

.xds.type.matcher.v3.StringMatcher

[.xds.type.matcher.v3.StringMatcher proto]

指定比對字串的方式。

{
  "exact": ...,
  "prefix": ...,
  "suffix": ...,
  "safe_regex": {...},
  "contains": ...,
  "custom": {...},
  "ignore_case": ...
}
exact

(字串) 輸入字串必須與此處指定的字串完全匹配。

範例

  • abc 只匹配值 abc

必須設定 exactprefixsuffixsafe_regexcontainscustom 其中之一。

prefix

(字串) 輸入字串必須具有此處指定的前綴。注意:不允許空前綴,請改用正規表示式。

範例

  • abc 匹配值 abc.xyz

必須設定 exactprefixsuffixsafe_regexcontainscustom 其中之一。

suffix

(字串) 輸入字串必須具有此處指定的後綴。注意:不允許空前綴,請改用正規表示式。

範例

  • abc 匹配值 xyz.abc

必須設定 exactprefixsuffixsafe_regexcontainscustom 其中之一。

safe_regex

(.xds.type.matcher.v3.RegexMatcher) 輸入字串必須與此處指定的正規表示式匹配。

必須設定 exactprefixsuffixsafe_regexcontainscustom 其中之一。

contains

(字串) 輸入字串必須包含此處指定的子字串。注意:不允許空包含匹配,請改用正規表示式。

範例

  • abc 匹配值 xyz.abc.def

必須設定 exactprefixsuffixsafe_regexcontainscustom 其中之一。

custom

(.xds.core.v3.TypedExtensionConfig) 使用擴充功能作為比對器類型。

提示

此擴充功能類別具有以下已知擴充功能

必須設定 exactprefixsuffixsafe_regexcontainscustom 其中之一。

ignore_case

(布林值) 如果為 true,表示精確/前綴/後綴匹配應不區分大小寫。這對 safe_regex 匹配無效。例如,如果設定為 true,比對器 data 將匹配輸入字串 Datadata

.xds.type.matcher.v3.ListStringMatcher

[.xds.type.matcher.v3.ListStringMatcher proto]

指定比對字串的多種方式的清單。

{
  "patterns": []
}
patterns

(重複 .xds.type.matcher.v3.StringMatcher必要)