kamilsk / retry

♻️ The most advanced interruptible mechanism to perform actions repetitively until successful.
https://pkg.go.dev/github.com/kamilsk/retry/v5
MIT License
340 stars 14 forks source link

add strategy based on classifier package #76

Closed kamilsk closed 5 years ago

kamilsk commented 7 years ago

the concept:

func Whitelist(errors ...error) Strategy {
    whitelist := classifier.WhitelistClassifier(errors)
    return func(attempt uint, err error) bool {
        return whitelist.Classify(err) == classifier.Retry
    }
}
kamilsk commented 6 years ago

also, add the example from example_error_test.go

kamilsk commented 5 years ago

won't do