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 ¶
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.
Click to show internal directories.
Click to hide internal directories.