
Security News
Packagist Urges Immediate Composer Update After GitHub Actions Token Leak
Packagist urges PHP projects to update Composer after a GitHub token format change exposed some GitHub Actions tokens in CI logs.
github.com/BufferZoneCorp/go-retryablehttp
Advanced tools
go-retryablehttp is an HTTP client for Go with automatic retries, configurable exponential backoff, and a simple API surface. It is designed as a compatible alternative to hashicorp/go-retryablehttp with no external dependencies.
Requests are transparently retried on connection errors and 5xx responses. The client is safe for concurrent use.
go get github.com/BufferZoneCorp/go-retryablehttp
import "github.com/BufferZoneCorp/go-retryablehttp"
package main
import (
"fmt"
"io"
"log"
retryablehttp "github.com/BufferZoneCorp/go-retryablehttp"
)
func main() {
client := retryablehttp.NewClient()
resp, err := client.Get("https://api.example.com/data")
if err != nil {
log.Fatal(err)
}
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Printf("status %d: %s\n", resp.StatusCode, body)
}
import (
"os"
"time"
retryablehttp "github.com/BufferZoneCorp/go-retryablehttp"
)
client := retryablehttp.NewClient()
client.RetryMax = 5
client.RetryWaitMin = 500 * time.Millisecond
client.RetryWaitMax = 10 * time.Second
client.Logger = os.Stderr // log retry attempts
import (
"bytes"
"encoding/json"
retryablehttp "github.com/BufferZoneCorp/go-retryablehttp"
)
client := retryablehttp.NewClient()
payload, _ := json.Marshal(map[string]string{"event": "deploy", "env": "prod"})
resp, err := client.Post(
"https://hooks.example.com/events",
"application/json",
bytes.NewReader(payload),
)
| Setting | Default |
|---|---|
RetryMax | 3 |
RetryWaitMin | 1s |
RetryWaitMax | 30s |
| HTTP client timeout | 30s |
| Logger | io.Discard (silent) |
| Field | Type | Description |
|---|---|---|
HTTPClient | *http.Client | Underlying HTTP client (override for custom transport) |
RetryMax | int | Maximum number of retries (not counting the initial attempt) |
RetryWaitMin | time.Duration | Minimum wait between retries |
RetryWaitMax | time.Duration | Maximum wait between retries |
Logger | io.Writer | Destination for retry log lines (os.Stderr, a logger, etc.) |
| Method | Signature | Description |
|---|---|---|
NewClient | () *Client | Create a client with sane defaults |
Get | (url string) (*http.Response, error) | Retryable GET |
Post | (url, contentType string, body io.Reader) (*http.Response, error) | Retryable POST |
A request is retried when:
Backoff is linear by default: RetryWaitMin * attempt, capped at RetryWaitMax.
MIT — see LICENSE.
FAQs
Unknown package
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Packagist urges PHP projects to update Composer after a GitHub token format change exposed some GitHub Actions tokens in CI logs.

Research
GemStuffer abuses RubyGems as an exfiltration channel, packaging scraped UK council portal data into junk gems published from new accounts.

Company News
Socket was named to the Rising in Cyber 2026 list, recognizing 30 private cybersecurity startups selected by CISOs and security executives.