backoff

package
v0.7.8 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const Stop = backoff.Stop

Stop indicates that no more retries should be made for use in NextBackOff().

Variables

View Source
var (
	BackoffKind_name = map[int32]string{
		0: "BackoffKind_UNKNOWN",
		1: "BackoffKind_EXPONENTIAL",
		2: "BackoffKind_CONSTANT",
	}
	BackoffKind_value = map[string]int32{
		"BackoffKind_UNKNOWN":     0,
		"BackoffKind_EXPONENTIAL": 1,
		"BackoffKind_CONSTANT":    2,
	}
)

Enum value maps for BackoffKind.

View Source
var (
	ErrInvalidLength        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflow          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroup = fmt.Errorf("proto: unexpected end of group")
)
View Source
var File_github_com_aperturerobotics_bifrost_util_backoff_backoff_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type Backoff

type Backoff struct {

	// BackoffKind is the kind of backoff.
	BackoffKind BackoffKind `protobuf:"varint,1,opt,name=backoff_kind,json=backoffKind,proto3,enum=backoff.BackoffKind" json:"backoff_kind,omitempty"`
	// Exponential is the arguments for an exponential backoff.
	Exponential *Exponential `protobuf:"bytes,2,opt,name=exponential,proto3" json:"exponential,omitempty"`
	// Constant is the arugment for a constant backoff.
	Constant *Constant `protobuf:"bytes,3,opt,name=constant,proto3" json:"constant,omitempty"`
	// contains filtered or unexported fields
}

Backoff configures a backoff.

func (*Backoff) Construct

func (b *Backoff) Construct() backoff.BackOff

Construct constructs the backoff. Validates the options.

func (*Backoff) Descriptor deprecated

func (*Backoff) Descriptor() ([]byte, []int)

Deprecated: Use Backoff.ProtoReflect.Descriptor instead.

func (*Backoff) EqualVT added in v0.3.0

func (this *Backoff) EqualVT(that *Backoff) bool

func (*Backoff) GetBackoffKind

func (x *Backoff) GetBackoffKind() BackoffKind

func (*Backoff) GetConstant

func (x *Backoff) GetConstant() *Constant

func (*Backoff) GetEmpty added in v0.7.1

func (b *Backoff) GetEmpty() bool

GetEmpty returns if the backoff config is empty.

func (*Backoff) GetExponential

func (x *Backoff) GetExponential() *Exponential

func (*Backoff) MarshalToSizedBufferVT added in v0.2.0

func (m *Backoff) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*Backoff) MarshalToVT added in v0.2.0

func (m *Backoff) MarshalToVT(dAtA []byte) (int, error)

func (*Backoff) MarshalVT added in v0.2.0

func (m *Backoff) MarshalVT() (dAtA []byte, err error)

func (*Backoff) ProtoMessage

func (*Backoff) ProtoMessage()

func (*Backoff) ProtoReflect added in v0.2.0

func (x *Backoff) ProtoReflect() protoreflect.Message

func (*Backoff) Reset

func (x *Backoff) Reset()

func (*Backoff) SizeVT added in v0.2.0

func (m *Backoff) SizeVT() (n int)

func (*Backoff) String

func (x *Backoff) String() string

func (*Backoff) UnmarshalVT added in v0.2.0

func (m *Backoff) UnmarshalVT(dAtA []byte) error

type BackoffKind

type BackoffKind int32

BackoffKind is the kind of backoff.

const (
	// BackoffKind_UNKNOWN defaults to BackoffKind_EXPONENTIAL
	BackoffKind_BackoffKind_UNKNOWN BackoffKind = 0
	// BackoffKind_EXPONENTIAL is an exponential backoff.
	BackoffKind_BackoffKind_EXPONENTIAL BackoffKind = 1
	// BackoffKind_CONSTANT is a constant backoff.
	BackoffKind_BackoffKind_CONSTANT BackoffKind = 2
)

func (BackoffKind) Descriptor added in v0.2.0

func (BackoffKind) Enum added in v0.2.0

func (x BackoffKind) Enum() *BackoffKind

func (BackoffKind) EnumDescriptor deprecated

func (BackoffKind) EnumDescriptor() ([]byte, []int)

Deprecated: Use BackoffKind.Descriptor instead.

func (BackoffKind) Number added in v0.2.0

func (x BackoffKind) Number() protoreflect.EnumNumber

func (BackoffKind) String

func (x BackoffKind) String() string

func (BackoffKind) Type added in v0.2.0

type Constant

type Constant struct {

	// Interval is the timing to back off, in milliseconds.
	// Defaults to 5 seconds.
	Interval uint32 `protobuf:"varint,1,opt,name=interval,proto3" json:"interval,omitempty"`
	// contains filtered or unexported fields
}

Constant contains constant backoff options.

func (*Constant) Descriptor deprecated

func (*Constant) Descriptor() ([]byte, []int)

Deprecated: Use Constant.ProtoReflect.Descriptor instead.

func (*Constant) EqualVT added in v0.3.0

func (this *Constant) EqualVT(that *Constant) bool

func (*Constant) GetInterval

func (x *Constant) GetInterval() uint32

func (*Constant) MarshalToSizedBufferVT added in v0.2.0

func (m *Constant) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*Constant) MarshalToVT added in v0.2.0

func (m *Constant) MarshalToVT(dAtA []byte) (int, error)

func (*Constant) MarshalVT added in v0.2.0

func (m *Constant) MarshalVT() (dAtA []byte, err error)

func (*Constant) ProtoMessage

func (*Constant) ProtoMessage()

func (*Constant) ProtoReflect added in v0.2.0

func (x *Constant) ProtoReflect() protoreflect.Message

func (*Constant) Reset

func (x *Constant) Reset()

func (*Constant) SizeVT added in v0.2.0

func (m *Constant) SizeVT() (n int)

func (*Constant) String

func (x *Constant) String() string

func (*Constant) UnmarshalVT added in v0.2.0

func (m *Constant) UnmarshalVT(dAtA []byte) error

type Exponential

type Exponential struct {

	// InitialInterval is the initial interval in milliseconds.
	// Default: 800ms.
	InitialInterval uint32 `protobuf:"varint,1,opt,name=initial_interval,json=initialInterval,proto3" json:"initial_interval,omitempty"`
	// Multiplier is the timing multiplier.
	// Default: 1.8
	Multiplier float32 `protobuf:"fixed32,2,opt,name=multiplier,proto3" json:"multiplier,omitempty"`
	// MaxInterval is the maximum timing interval in milliseconds.
	// Default: 20 seconds
	MaxInterval uint32 `protobuf:"varint,3,opt,name=max_interval,json=maxInterval,proto3" json:"max_interval,omitempty"`
	// RandomizationFactor is the randomization factor.
	// Default: 0
	RandomizationFactor float32 `protobuf:"fixed32,4,opt,name=randomization_factor,json=randomizationFactor,proto3" json:"randomization_factor,omitempty"`
	// MaxElapsedTime if set specifies a maximum time for the backoff, in milliseconds.
	// After this time the backoff and attached process terminates.
	// May be empty, might be ignored.
	MaxElapsedTime uint32 `protobuf:"varint,5,opt,name=max_elapsed_time,json=maxElapsedTime,proto3" json:"max_elapsed_time,omitempty"`
	// contains filtered or unexported fields
}

Exponential is the exponential arguments.

func (*Exponential) Descriptor deprecated

func (*Exponential) Descriptor() ([]byte, []int)

Deprecated: Use Exponential.ProtoReflect.Descriptor instead.

func (*Exponential) EqualVT added in v0.3.0

func (this *Exponential) EqualVT(that *Exponential) bool

func (*Exponential) GetInitialInterval

func (x *Exponential) GetInitialInterval() uint32

func (*Exponential) GetMaxElapsedTime

func (x *Exponential) GetMaxElapsedTime() uint32

func (*Exponential) GetMaxInterval

func (x *Exponential) GetMaxInterval() uint32

func (*Exponential) GetMultiplier

func (x *Exponential) GetMultiplier() float32

func (*Exponential) GetRandomizationFactor

func (x *Exponential) GetRandomizationFactor() float32

func (*Exponential) MarshalToSizedBufferVT added in v0.2.0

func (m *Exponential) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*Exponential) MarshalToVT added in v0.2.0

func (m *Exponential) MarshalToVT(dAtA []byte) (int, error)

func (*Exponential) MarshalVT added in v0.2.0

func (m *Exponential) MarshalVT() (dAtA []byte, err error)

func (*Exponential) ProtoMessage

func (*Exponential) ProtoMessage()

func (*Exponential) ProtoReflect added in v0.2.0

func (x *Exponential) ProtoReflect() protoreflect.Message

func (*Exponential) Reset

func (x *Exponential) Reset()

func (*Exponential) SizeVT added in v0.2.0

func (m *Exponential) SizeVT() (n int)

func (*Exponential) String

func (x *Exponential) String() string

func (*Exponential) UnmarshalVT added in v0.2.0

func (m *Exponential) UnmarshalVT(dAtA []byte) error

Jump to

Keyboard shortcuts

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