MCPcopy
hub / github.com/grpc/grpc-go / WithConnectParams

Function WithConnectParams

dialoptions.go:324–331  ·  view source on GitHub ↗

WithConnectParams configures the ClientConn to use the provided ConnectParams for creating and maintaining connections to servers. The backoff configuration specified as part of the ConnectParams overrides all defaults specified in https://github.com/grpc/grpc/blob/master/doc/connection-backoff.md.

(p ConnectParams)

Source from the content-addressed store, hash-verified

322// using the backoff.DefaultConfig as a base, in cases where you want to
323// override only a subset of the backoff configuration.
324func WithConnectParams(p ConnectParams) DialOption {
325 return newFuncDialOption(func(o *dialOptions) {
326 o.bs = internalbackoff.Exponential{Config: p.Backoff}
327 o.minConnectTimeout = func() time.Duration {
328 return p.MinConnectTimeout
329 }
330 })
331}
332
333// WithBackoffMaxDelay configures the dialer to use the provided maximum delay
334// when backing off after failed connection attempts.

Calls 1

newFuncDialOptionFunction · 0.85