Documentation
¶
Index ¶
- Constants
- func BackoffMultiplier(c *config.Config) float64
- func HeadTimeout(c *config.Config) time.Duration
- func InitialBackoff(c *config.Config) time.Duration
- func MaxAttempts(c *config.Config) uint64
- func MaxBackoff(c *config.Config) time.Duration
- func MaxTokens(c *config.Config) int64
- func RetryPolicyEnabled(c *config.Config) bool
- func ThrottlingEnabled(c *config.Config) bool
- func TokenDecrement(c *config.Config) int64
- func TokenRatio(c *config.Config) int64
- func UnsafeDisable(c *config.Config) bool
Constants ¶
const ( // HeadTimeoutDefault is a default object.Head request timeout in policer. HeadTimeoutDefault = 5 * time.Second // MaxAttemptsDefault is a default number of attempts for policer's client. MaxAttemptsDefault = uint64(5) // InitialBackoffDefault is a default value for initial backoff timeout. InitialBackoffDefault = 100 * time.Millisecond // MaxBackoffDefault is a default value for maximum backoff timeout. MaxBackoffDefault = time.Second // BackoffMultiplierDefault is a default value for backoff multiplier. BackoffMultiplierDefault = float64(2) // TokenRatioDefault is a default value for token ratio. TokenRatioDefault = int64(1) // MaxTokensDefault is a default value for maximum tokens. MaxTokensDefault = int64(100) // TokenDecrementDefault if a default value for decrement token. TokenDecrementDefault = int64(10) )
Variables ¶
This section is empty.
Functions ¶
func BackoffMultiplier ¶ added in v0.46.10
BackoffMultiplier returns the value of "backoff_multiplier" config parameter from "retry_policy" section.
Returns BackoffMultiplierDefault if the value is not positive duration.
func HeadTimeout ¶
HeadTimeout returns the value of "head_timeout" config parameter from "policer" section.
Returns HeadTimeoutDefault if the value is not positive duration.
func InitialBackoff ¶ added in v0.46.10
InitialBackoff returns the value of "initial_backoff" config parameter from "retry_policy" section.
Returns InitialBackoffDefault if the value is not positive duration.
func MaxAttempts ¶ added in v0.46.10
MaxAttempts returns the value of "max_attempts" config parameter from "retry_policy" section.
Returns MaxAttemptsDefault if the value is not positive duration.
func MaxBackoff ¶ added in v0.46.10
MaxBackoff returns the value of "max_backoff" config parameter from "retry_policy" section.
Returns MaxBackoffDefault if the value is not positive duration.
func MaxTokens ¶ added in v0.46.10
MaxTokens returns the value of "max_tokens" config parameter from "throttling" section.
Returns MaxTokensDefault by default.
func RetryPolicyEnabled ¶ added in v0.46.10
RetryPolicyEnabled returns the value of "enabled" config parameter from "retry_policy" section.
Returns false by default.
func ThrottlingEnabled ¶ added in v0.46.10
ThrottlingEnabled returns the value of "enabled" config parameter from "throttling" section.
Returns false by default.
func TokenDecrement ¶ added in v0.46.10
TokenDecrement returns the value of "token_decrement" config parameter from "throttling" section.
Returns TokenDecrementDefault by default.
func TokenRatio ¶ added in v0.46.10
TokenRatio returns the value of "token_ratio" config parameter from "throttling" section.
Returns TokenRatioDefault by default.
func UnsafeDisable ¶ added in v0.37.0
UnsafeDisable returns the value of "unsafe_disable" config parameter from "policer" section.
Types ¶
This section is empty.