Documentation ¶
Index ¶
- Variables
- type CustomResponse
- func (*CustomResponse) Descriptor() ([]byte, []int)deprecated
- func (x *CustomResponse) GetCustomResponseMatcher() *v3.Matcher
- func (*CustomResponse) ProtoMessage()
- func (x *CustomResponse) ProtoReflect() protoreflect.Message
- func (x *CustomResponse) Reset()
- func (x *CustomResponse) String() string
- func (m *CustomResponse) Validate() error
- func (m *CustomResponse) ValidateAll() error
- type CustomResponseMultiError
- type CustomResponseValidationError
- func (e CustomResponseValidationError) Cause() error
- func (e CustomResponseValidationError) Error() string
- func (e CustomResponseValidationError) ErrorName() string
- func (e CustomResponseValidationError) Field() string
- func (e CustomResponseValidationError) Key() bool
- func (e CustomResponseValidationError) Reason() string
Constants ¶
This section is empty.
Variables ¶
var File_envoy_extensions_filters_http_custom_response_v3_custom_response_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type CustomResponse ¶
type CustomResponse struct { // Matcher to match against the original response to select a // :ref:`Custom Response Policy <extension_category_envoy.http.custom_response>` // that will override the original response. The matching is done by matching // against :ref:`response header values<extension_category_envoy.matching.http.input>` // Example: // // .. validated-code-block:: yaml // :type-name: xds.type.matcher.v3.Matcher // // matcher_list: // matchers: // # Apply a locally stored custom response to any 4xx response. // - predicate: // single_predicate: // input: // name: 4xx_response // typed_config: // "@type": type.googleapis.com/envoy.type.matcher.v3.HttpResponseStatusCodeClassMatchInput // value_match: // exact: "4xx" // on_match: // action: // name: action // typed_config: // "@type": type.googleapis.com/envoy.extensions.filters.http.custom_response.v3.LocalResponsePolicy // status_code: 499 // body: // inline_string: "not allowed" // body_format: // json_format: // status: "%RESPONSE_CODE%" // message: "%LOCAL_REPLY_BODY%" // response_headers_to_add: // - header: // key: "foo" // value: "x-bar" // # Redirect to different upstream if the status code is one of 502, 503 or 504. // - predicate: // or_matcher: // predicate: // - single_predicate: // input: // name: "502_response" // typed_config: // "@type": type.googleapis.com/envoy.type.matcher.v3.HttpResponseStatusCodeMatchInput // value_match: // exact: "502" // - single_predicate: // input: // name: "503_response" // typed_config: // "@type": type.googleapis.com/envoy.type.matcher.v3.HttpResponseStatusCodeMatchInput // value_match: // exact: "503" // - single_predicate: // input: // name: "504_response" // typed_config: // "@type": type.googleapis.com/envoy.type.matcher.v3.HttpResponseStatusCodeMatchInput // value_match: // exact: "504" // on_match: // action: // name: action // typed_config: // "@type": type.googleapis.com/envoy.extensions.filters.http.custom_response.v3.RedirectPolicy // status_code: 299 // uri: "https://foo.example/gateway_error" // response_headers_to_add: // - header: // key: "foo2" // value: "x-bar2" // // -- attention:: // The first matched policy wins. Once the response is matched, matcher // evaluations end. // // Refer to :ref:`Unified Matcher API <envoy_v3_api_msg_.xds.type.matcher.v3.Matcher>` // documentation for more information on the matcher trees. // [#extension-category: envoy.http.custom_response] CustomResponseMatcher *v3.Matcher `` /* 126-byte string literal not displayed */ // contains filtered or unexported fields }
The filter configuration is a collection of custom response policies in a matcher tree. The configuration can be defined at the filter, virtual host or route level. The most specific configuration will apply.
func (*CustomResponse) Descriptor
deprecated
func (*CustomResponse) Descriptor() ([]byte, []int)
Deprecated: Use CustomResponse.ProtoReflect.Descriptor instead.
func (*CustomResponse) GetCustomResponseMatcher ¶
func (x *CustomResponse) GetCustomResponseMatcher() *v3.Matcher
func (*CustomResponse) ProtoMessage ¶
func (*CustomResponse) ProtoMessage()
func (*CustomResponse) ProtoReflect ¶
func (x *CustomResponse) ProtoReflect() protoreflect.Message
func (*CustomResponse) Reset ¶
func (x *CustomResponse) Reset()
func (*CustomResponse) String ¶
func (x *CustomResponse) String() string
func (*CustomResponse) Validate ¶
func (m *CustomResponse) Validate() error
Validate checks the field values on CustomResponse with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.
func (*CustomResponse) ValidateAll ¶
func (m *CustomResponse) ValidateAll() error
ValidateAll checks the field values on CustomResponse with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in CustomResponseMultiError, or nil if none found.
type CustomResponseMultiError ¶
type CustomResponseMultiError []error
CustomResponseMultiError is an error wrapping multiple validation errors returned by CustomResponse.ValidateAll() if the designated constraints aren't met.
func (CustomResponseMultiError) AllErrors ¶
func (m CustomResponseMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (CustomResponseMultiError) Error ¶
func (m CustomResponseMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type CustomResponseValidationError ¶
type CustomResponseValidationError struct {
// contains filtered or unexported fields
}
CustomResponseValidationError is the validation error returned by CustomResponse.Validate if the designated constraints aren't met.
func (CustomResponseValidationError) Cause ¶
func (e CustomResponseValidationError) Cause() error
Cause function returns cause value.
func (CustomResponseValidationError) Error ¶
func (e CustomResponseValidationError) Error() string
Error satisfies the builtin error interface
func (CustomResponseValidationError) ErrorName ¶
func (e CustomResponseValidationError) ErrorName() string
ErrorName returns error name.
func (CustomResponseValidationError) Field ¶
func (e CustomResponseValidationError) Field() string
Field function returns field value.
func (CustomResponseValidationError) Key ¶
func (e CustomResponseValidationError) Key() bool
Key function returns key value.
func (CustomResponseValidationError) Reason ¶
func (e CustomResponseValidationError) Reason() string
Reason function returns reason value.