#pragma once #include #include #include "absl/types/optional.h" #include "headers.h" #include "request_headers.h" namespace Envoy { namespace Platform { class RequestHeaders; enum RetryRule { Status5xx, GatewayError, ConnectFailure, RefusedStream, Retriable4xx, RetriableHeaders, Reset, }; std::string retry_rule_to_string(RetryRule retry_rule); RetryRule retry_rule_from_string(const std::string& str); struct RetryPolicy { int max_retry_count; std::vector retry_on; std::vector retry_status_codes; absl::optional per_try_timeout_ms; absl::optional total_upstream_timeout_ms; RawHeaderMap as_raw_header_map() const; static RetryPolicy from_raw_header_map(const RawHeaderMap& headers); }; using RetryPolicySharedPtr = std::shared_ptr; } // namespace Platform } // namespace Envoy