retry

package
v0.0.0-...-e0aa601 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package retry is a simple and easy retry mechanism package for Go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Do

func Do(attempt uint, sleep time.Duration, fn interface{}, args ...interface{}) ([]interface{}, error)

Do tries to execute the function by its value, function can take variadic arguments and return multiple return. You must put error as the last return value so that DoFunc can take decision that the call failed or not

func DoFunc

func DoFunc(attempts uint, sleep time.Duration, fn func(left uint) error) error

DoFunc tries to execute the function, it expects that the function will return an error

func UnaryInterceptor

func UnaryInterceptor(logger *zap.Logger, attempts uint, sleep time.Duration) grpc.UnaryClientInterceptor

UnaryInterceptor is the custom retry unary interceptor

Types

This section is empty.

Jump to

Keyboard shortcuts

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