Documentation
¶
Index ¶
- func DefaultNameConfig() nameConfig
- func DefaultRetryDialOption() (grpc.DialOption, error)
- func NewNameConfig(service, method string) nameConfig
- func RetryDialOption(opts ...RetryOption) (grpc.DialOption, error)
- type Duration
- type GRPCKeepAliveConfig
- type RetryConfig
- type RetryOption
- type ThrottlingMode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultNameConfig ¶
func DefaultNameConfig() nameConfig
func DefaultRetryDialOption ¶
func DefaultRetryDialOption() (grpc.DialOption, error)
DefaultRetryDialOption returns DialOption that configures the default service config, which will be used in cases where:
1. User provide service config in SDK build after DefaultRetryDialOption function. In this case retries configuration override user's service config.
2. User don't get service config through xDS. In that case service config from xDS override retries configuration.
func NewNameConfig ¶
func NewNameConfig(service, method string) nameConfig
func RetryDialOption ¶
func RetryDialOption(opts ...RetryOption) (grpc.DialOption, error)
RetryDialOption returns DialOption that configures the default service config, which will be used in cases where:
1. User provide service config in SDK build after RetryDialOption function. In this case retries configuration override user's service config.
2. User don't get service config through xDS. In that case service config from xDS override retries configuration.
It's recommended to use default configuration (DefaultRetryDialOption) for retries in SDK to avoid retry amplification.
Types ¶
type Duration ¶
Duration defines JSON marshal and unmarshal methods to conform to the protobuf JSON spec defined here.
func (Duration) MarshalJSON ¶
MarshalJSON converts from d to a JSON string output.
type GRPCKeepAliveConfig ¶
type RetryConfig ¶
type RetryConfig struct {
// contains filtered or unexported fields
}
func DefaultRetryConfig ¶
func DefaultRetryConfig() *RetryConfig
type RetryOption ¶
type RetryOption func(c *RetryConfig)
func WithDefaultRetryConfig ¶
func WithDefaultRetryConfig() RetryOption
func WithRetries ¶
func WithRetries(nm nameConfig, n int) RetryOption
func WithRetryableStatusCodes ¶
func WithRetryableStatusCodes(nm nameConfig, codes ...codes.Code) RetryOption
func WithThrottlingMode ¶
func WithThrottlingMode(mode ThrottlingMode) RetryOption
type ThrottlingMode ¶
type ThrottlingMode string
ThrottlingMode provides the mode SDK will retry request.
const ( // ThrottlingModePersistent model provides retry attempts and budget for persistent environments. // This mode is suitable when you use SDK in your server application, or any long-lived applications. ThrottlingModePersistent ThrottlingMode = "persistent" // ThrottlingModeTemporary model provides retry attempts and budget for temporary environments. // This mode is suitable when you use SDK in some CI scripts, or any short-lived applications. ThrottlingModeTemporary ThrottlingMode = "temporary" )