字串比對器 (proto)

type.matcher.v3.StringMatcher

[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

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

必須設定 exactprefixsuffixsafe_regexcontainscustom 其中一個。

contains

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

範例

  • abc 比對值 xyz.abc.def

必須設定 exactprefixsuffixsafe_regexcontainscustom 其中一個。

custom

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

提示

此擴展類別具有以下已知擴展

必須設定 exactprefixsuffixsafe_regexcontainscustom 其中一個。

ignore_case

(布林值) 如果為 true,表示 exact/prefix/suffix/contains 比對應該不區分大小寫。這對 safe_regex 比對沒有影響。例如,如果設定為 true,比對器 data 將比對輸入字串 Datadata

type.matcher.v3.ListStringMatcher

[type.matcher.v3.ListStringMatcher proto]

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

{
  "patterns": []
}
patterns

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