common

package
v0.0.0-...-7e38a4a Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// RetryMaxAttempts sets the maximum number of attempts when retrying
	RetryMaxAttempts = 10

	// RetryBackoffFactor sets the exponential backoff factor on wait duration
	RetryBackoffFactor = 2

	// RetryBackoffMax sets the maximum wait duration between retry attempts
	RetryBackoffMax = 10000 // milliseconds
)

Variables

This section is empty.

Functions

func BoolToInt

func BoolToInt(b types.BitBool) int

BoolToInt converts a boolean to an integer

func Max

func Max[V int | int8 | int16 | int32 | int64 | float32 | float64](x, y V) V

Max returns the greater of two numbers

func Min

func Min[V int | int8 | int16 | int32 | int64 | float32 | float64](x, y V) V

Min returns the smaller of two numbers

func RetryWithBackoff

func RetryWithBackoff(run func() error) error

RetryWithBackoff implements a retry-loop with an expontential backoff algorithm

func VolumeString

func VolumeString(vol int, mute types.BitBool) string

VolumeString returns a percentage string for volume controls

Types

This section is empty.

Jump to

Keyboard shortcuts

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