Skip to content
This repository has been archived by the owner on Sep 24, 2022. It is now read-only.

Latest commit

 

History

History

strategy

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

strategy

import "github.com/go-orion/Orion/utils/httptripper/strategy"

Package strategy provides strategies for use with retry

No packages beyond the Go standard library are imported.

strategy.go types.go

type Strategy interface {
    //WaitDuration takes attempt, maxRetry and request/response paramaetrs as input and gives out a duration as response
    WaitDuration(attempt, maxRetry int, req *http.Request, resp *http.Response, err error) time.Duration
}

Strategy is the interface requirement for any strategy implementation

func DefaultStrategy(duration time.Duration) Strategy

DefaultStrategy provides implementation for Fixed duration wait

func ExponentialStrategy(duration time.Duration) Strategy

ExponentialStrategy provided implementation for exponentially (in powers of 2) growing wait duration


Generated by godoc2ghmd