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

jeffotoni / quick / 215

04 Mar 2025 04:52PM UTC coverage: 49.633% (+0.4%) from 49.209%
215

push

circleci

jeffotoni
Merge branch 'feature/refactory_http_client'

Carnival went on until dawn, refactoring our client.go, redoing it,
removing all complexity, removing obsolete functions, and leaving
everything clean.
I removed everything unnecessary from the tests and we closed at 91%
coverage.
Now we will focus on the documentation, the pkg go doc, and examples.
We returned the examples to quick for better maintenance and testing.
Now we will evolve.

119 of 160 new or added lines in 5 files covered. (74.38%)

2 existing lines in 1 file now uncovered.

1824 of 3675 relevant lines covered (49.63%)

2715.79 hits per line

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

0.0
/example/quick.http.client/full.retray/main.go
1
package main
2

3
import (
4
        "crypto/tls"
5
        "fmt"
6
        "log"
7
        "net/http"
8
        "time"
9

10
        "github.com/jeffotoni/quick/http/client"
11
)
12

13
func main() {
×
14

×
15
        // when I declare the 2 retrys, WithRetry RoundTripper and WithRetry ,
×
16
        // the With Retry RoundTripper overrides it which is executed.
×
17
        cClient := client.New(
×
18
                client.WithTimeout(5*time.Second),
×
19
                client.WithHeaders(map[string]string{"Content-Type": "application/json"}),
×
20

×
21
                // Advanced HTTP transport configuration
×
22
                client.WithTransportConfig(&http.Transport{
×
23
                        Proxy:               http.ProxyFromEnvironment,
×
24
                        TLSClientConfig:     &tls.Config{InsecureSkipVerify: true},
×
25
                        ForceAttemptHTTP2:   true,
×
26
                        MaxIdleConns:        20,
×
27
                        MaxIdleConnsPerHost: 10,
×
28
                        MaxConnsPerHost:     20,
×
29
                        DisableKeepAlives:   false,
×
30
                }),
×
31

×
NEW
32
                // WithRetry
×
NEW
33
                client.WithRetry(
×
34
                        client.RetryConfig{
×
35
                                MaxRetries: 2,
×
36
                                Delay:      1 * time.Second,
×
37
                                UseBackoff: true,
×
38
                                Statuses:   []int{500},
×
39
                                EnableLog:  true,
×
40
                        }),
×
41

×
42
                // Retry quick
×
43
                // client.WithRetry(5, "2s-bex", "500,502,503,504"),
×
44
        )
×
45

×
46
        resp, err := cClient.Post("http://localhost:3000/v1/user", map[string]string{"name": "jeffotoni"})
×
47
        if err != nil {
×
48
                log.Fatalf("POST request failed: %v", err)
×
49
        }
×
50
        fmt.Println("POST Form Response:", string(resp.Body))
×
51
}
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