Documentation ¶
Index ¶
- Variables
- func CopyBody(resp *http.Response) ([]byte, error)
- func CreateFormPayload(textFields, fileFields map[string]string) (*bytes.Buffer, error)
- func CreateJSONPayload(data map[string]interface{}) (body *bytes.Buffer, err error)
- func Error(resp *http.Response) error
- func RandomUA() string
- func ReadBody(resp *http.Response) ([]byte, error)
- type BackOffClient
- type Request
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DefaultBackOff = &backoff.ExponentialBackOff{ InitialInterval: 200 * time.Millisecond, RandomizationFactor: backoff.DefaultRandomizationFactor, Multiplier: backoff.DefaultMultiplier, MaxInterval: 5 * time.Second, MaxElapsedTime: 10 * time.Second, Clock: backoff.SystemClock, } DefaultNotify = func(err error, t time.Duration) { log.Printf("BackOff err: %+v, retry duration: %d ms", err, t.Milliseconds()) } )
Functions ¶
func CreateFormPayload ¶
func CreateJSONPayload ¶
Types ¶
type BackOffClient ¶ added in v1.0.6
Click to show internal directories.
Click to hide internal directories.