Skip to content

🔄 Retry provides a set of standardized common components and abstracts away some code that normally is duplicated

License

Notifications You must be signed in to change notification settings

go-playground/retry

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Retry library

Project status Build Status Coverage Status Go Report Card GoDoc License

Retry library provides a set of standardized common components and abstracts away some code that normally is duplicated. My motivation is not to reinvent the wheel but to standardize a set of components for reuse in other libraries.

Example

package main

import (
	"errors"
	"fmt"

	"github.com/go-playground/retry"
)

func main() {
	err := retry.Run(5, func() (bool, error) {
		return false, errors.New("ERR")
	},
		func(attempt uint16, err error) {
			fmt.Printf("Attempt: %d Error: %s\n", attempt, err)
		},
	)
	if err != nil {
		panic(err)
	}
}

Package Versioning

I'm jumping on the vendoring bandwagon, you should vendor this package as I will not be creating different version with gopkg.in like allot of my other libraries.

Why? because my time is spread pretty thin maintaining all of the libraries I have + LIFE, it is so freeing not to worry about it and will help me keep pouring out bigger and better things for you the community.

License

Distributed under MIT License, please see license file in code for more details.

About

🔄 Retry provides a set of standardized common components and abstracts away some code that normally is duplicated

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages