Movatterモバイル変換


[0]ホーム

URL:


backoff

package
v1.92.2Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2025 License:BSD-3-ClauseImports:5Imported by:0

Details

Repository

github.com/tailscale/tailscale

Links

Documentation

Overview

Package backoff provides a back-off timer type.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

typeBackoff

type Backoff struct {// tstime.Clock.NewTimer is used instead time.NewTimer.Clocktstime.Clock// LogLongerThan sets the minimum time of a single backoff interval// before we mention it in the log.LogLongerThantime.Duration// contains filtered or unexported fields}

Backoff tracks state the history of consecutive failures and sleepsan increasing amount of time, up to a provided limit.

funcNewBackoff

func NewBackoff(namestring, logflogger.Logf, maxBackofftime.Duration) *Backoff

NewBackoff returns a new Backoff timer with the provided name (for logging), logger,and max backoff time. By default, all failures (calls to BackOff with a non-nil err)are logged unless the returned Backoff.LogLongerThan is adjusted.

func (*Backoff)BackOff

func (b *Backoff) BackOff(ctxcontext.Context, errerror)

BackOff sleeps an increasing amount of time if err is non-nil while thecontext is active. It resets the backoff schedule once err is nil.

func (*Backoff)Resetadded inv1.92.0

func (b *Backoff) Reset()

Reset resets the backoff schedule, equivalent to calling BackOff with a nilerror.

Source Files

View all Source files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp