policerconfig

package
v0.46.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 22, 2025 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
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

func BackoffMultiplier(c *config.Config) float64

BackoffMultiplier returns the value of "backoff_multiplier" config parameter from "retry_policy" section.

Returns BackoffMultiplierDefault if the value is not positive duration.

func HeadTimeout

func HeadTimeout(c *config.Config) time.Duration

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

func InitialBackoff(c *config.Config) time.Duration

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

func MaxAttempts(c *config.Config) uint64

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

func MaxBackoff(c *config.Config) time.Duration

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

func MaxTokens(c *config.Config) int64

MaxTokens returns the value of "max_tokens" config parameter from "throttling" section.

Returns MaxTokensDefault by default.

func RetryPolicyEnabled added in v0.46.10

func RetryPolicyEnabled(c *config.Config) bool

RetryPolicyEnabled returns the value of "enabled" config parameter from "retry_policy" section.

Returns false by default.

func ThrottlingEnabled added in v0.46.10

func ThrottlingEnabled(c *config.Config) bool

ThrottlingEnabled returns the value of "enabled" config parameter from "throttling" section.

Returns false by default.

func TokenDecrement added in v0.46.10

func TokenDecrement(c *config.Config) int64

TokenDecrement returns the value of "token_decrement" config parameter from "throttling" section.

Returns TokenDecrementDefault by default.

func TokenRatio added in v0.46.10

func TokenRatio(c *config.Config) int64

TokenRatio returns the value of "token_ratio" config parameter from "throttling" section.

Returns TokenRatioDefault by default.

func UnsafeDisable added in v0.37.0

func UnsafeDisable(c *config.Config) bool

UnsafeDisable returns the value of "unsafe_disable" config parameter from "policer" section.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL