• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

jeffotoni / quick / 220

06 Mar 2025 07:11PM UTC coverage: 50.54% (+0.1%) from 50.442%
220

push

circleci

jeffotoni
fixing and improving some retry failover examples

1 of 47 new or added lines in 5 files covered. (2.13%)

1825 of 3611 relevant lines covered (50.54%)

2764.03 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/example/quick.http.client/with.retry.failover/main.go
1
package main
2

3
import (
4
        "fmt"
5
        "log"
6
        "time"
7

8
        "github.com/jeffotoni/quick/http/client"
9
)
10

NEW
11
func main() {
×
NEW
12
        cClient := client.New(
×
NEW
13
                client.WithTimeout(10*time.Second),
×
NEW
14
                client.WithHeaders(map[string]string{
×
NEW
15
                        "Content-Type": "application/json",
×
NEW
16
                }),
×
NEW
17
                // Enabling retry
×
NEW
18
                client.WithRetry(
×
NEW
19
                        client.RetryConfig{
×
NEW
20
                                MaxRetries:   2,
×
NEW
21
                                Delay:        1 * time.Second,
×
NEW
22
                                UseBackoff:   true,
×
NEW
23
                                Statuses:     []int{500, 502, 503},
×
NEW
24
                                FailoverURLs: []string{"http://hosterror", "https://httpbin.org/post"},
×
NEW
25
                                EnableLog:    true,
×
NEW
26
                        }),
×
NEW
27
        )
×
NEW
28

×
NEW
29
        // call POST
×
NEW
30
        resp, err := cClient.Post("https://httpbin_error.org/post", map[string]string{
×
NEW
31
                "name": "jeffotoni in action with Quick!!!",
×
NEW
32
        })
×
NEW
33

×
NEW
34
        if err != nil {
×
NEW
35
                log.Fatalf("POST request failed: %v", err)
×
NEW
36
        }
×
NEW
37
        fmt.Println("POST Form Response:", string(resp.Body))
×
38
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc