runutil

package
v0.0.0-...-deab967 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloseWithErrCapture

func CloseWithErrCapture(logger log.Logger, err *error, closer io.Closer, format string, a ...interface{})

CloseWithErrCapture runs function and on error tries to return error by argument. If error is already there we assume that error has higher priority and we just log the function error.

func CloseWithLogOnErr

func CloseWithLogOnErr(logger log.Logger, closer io.Closer, format string, a ...interface{})

CloseWithLogOnErr is making sure we log every error, even those from best effort tiny closers.

func Repeat

func Repeat(interval time.Duration, stopc <-chan struct{}, f func() error) error

Repeat executes f every interval seconds until stopc is closed. It executes f once right after being called.

func Retry

func Retry(interval time.Duration, stopc <-chan struct{}, f func() error) error

Retry executes f every interval seconds until timeout or no error is returned from f.

func RetryWithLog

func RetryWithLog(logger log.Logger, interval time.Duration, stopc <-chan struct{}, f func() error) error

RetryWithLog executes f every interval seconds until timeout or no error is returned from f. It logs an error on each f error.

Types

This section is empty.

Jump to

Keyboard shortcuts

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