类 ConfigurableRequestItemParser<T>
java.lang.Object
com.alibaba.csp.sentinel.adapter.gateway.common.param.ConfigurableRequestItemParser<T>
- 所有已实现的接口:
RequestItemParser<T>
delegate RequestItemParser, support add extractors to customize request item parse.
example:
if you want to get client real ip in multi nginx proxy, you can register SentinelGatewayFilter bean as follows
ConfigurableRequestItemParser
- 作者:
- icodening
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明addCookieValueExtractor(BiFunction<T, String, String> extractor) addHeaderExtractor(BiFunction<T, String, String> extractor) addPathExtractor(Function<T, String> extractor) addRemoteAddressExtractor(Function<T, String> extractor) addUrlParamExtractor(BiFunction<T, String, String> extractor) getCookieValue(T request, String cookieName) Get the cookie value associated with the cookie name.Get the header associated with the header key.Get API path from the request.getRemoteAddress(T request) Get remote address from the request.getUrlParam(T request, String paramName) Get the parameter value associated with the parameter name.
-
构造器详细资料
-
ConfigurableRequestItemParser
-
-
方法详细资料
-
getPath
从接口复制的说明:RequestItemParserGet API path from the request.- 指定者:
getPath在接口中RequestItemParser<T>- 参数:
request- valid request- 返回:
- API path
-
getRemoteAddress
从接口复制的说明:RequestItemParserGet remote address from the request.- 指定者:
getRemoteAddress在接口中RequestItemParser<T>- 参数:
request- valid request- 返回:
- remote address
-
getHeader
从接口复制的说明:RequestItemParserGet the header associated with the header key.- 指定者:
getHeader在接口中RequestItemParser<T>- 参数:
request- valid requestkey- valid header key- 返回:
- the header
-
getUrlParam
从接口复制的说明:RequestItemParserGet the parameter value associated with the parameter name.- 指定者:
getUrlParam在接口中RequestItemParser<T>- 参数:
request- valid requestparamName- valid parameter name- 返回:
- the parameter value
-
getCookieValue
从接口复制的说明:RequestItemParserGet the cookie value associated with the cookie name.- 指定者:
getCookieValue在接口中RequestItemParser<T>- 参数:
request- valid requestcookieName- valid cookie name- 返回:
- the cookie value
-
addPathExtractor
-
addRemoteAddressExtractor
-
addHeaderExtractor
-
addUrlParamExtractor
-
addCookieValueExtractor
public ConfigurableRequestItemParser<T> addCookieValueExtractor(BiFunction<T, String, String> extractor)
-