File tree Expand file tree Collapse file tree
backend/pkg/transport/network/tcp Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ type ClientConfig struct {
1414 Context context.Context
1515
1616 TryReconnect bool
17- ConnectionBackoffFunction BackoffFunction
17+ ConnectionBackoffFunction backoffFunction
1818 MaxConnectionRetries int
1919}
2020
@@ -34,7 +34,7 @@ func NewClientConfig(laddr net.Addr) ClientConfig {
3434 }
3535}
3636
37- type BackoffFunction = func (int ) time.Duration
37+ type backoffFunction = func (int ) time.Duration
3838
3939const (
4040 defaultBackoffMin time.Duration = 100 * time .Millisecond
@@ -45,7 +45,7 @@ const (
4545// NewExponentialBackoff returns an exponential backoff function with the given paramenters.
4646//
4747// It follows this formula: delay = (min * (exp ^ n); delay < max ? delay : max
48- func NewExponentialBackoff (min time.Duration , exp float64 , max time.Duration ) BackoffFunction {
48+ func NewExponentialBackoff (min time.Duration , exp float64 , max time.Duration ) backoffFunction {
4949 return func (n int ) time.Duration {
5050 curr := time .Duration (float64 (min ) * math .Trunc (math .Pow (exp , float64 (n ))))
5151 if curr >= max {
You can’t perform that action at this time.
0 commit comments