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

ctfer-io / victor / 16466444133

23 Jul 2025 09:07AM UTC coverage: 0.0%. Remained the same
16466444133

Pull #257

github

pandatix
fix(#241): add `destroy-if-non-empty` flag
Pull Request #257: fix(#241): add `destroy-if-non-empty` flag

0 of 53 new or added lines in 5 files covered. (0.0%)

1 existing line in 1 file now uncovered.

0 of 323 relevant lines covered (0.0%)

0.0 hits per line

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

0.0
/http.go
1
package victor
2

3
import (
4
        "encoding/base64"
5
        "fmt"
6
        "net/http"
7

8
        "go.uber.org/zap"
9
)
10

11
// Client is the Victor's wrapper around a *http.Client that handles
12
// authentication and request management.
13
type Client struct {
14
        version string
15
        verbose bool
16

17
        username, password *string
18
        sub                *http.Client
19
}
20

21
// NewClient is a *Client factory.
22
func NewClient(version string, verbose bool, username, password *string) *Client {
×
23
        return &Client{
×
24
                version:  version,
×
25
                verbose:  verbose,
×
26
                username: username,
×
27
                password: password,
×
28
                sub:      &http.Client{},
×
29
        }
×
30
}
×
31

32
func (client *Client) Do(req *http.Request) (*http.Response, error) {
×
33
        if client.verbose {
×
34
                Log().Info("getting distant content",
×
35
                        zap.String("location", req.URL.String()),
×
36
                )
×
37
        }
×
38

NEW
39
        req.Header.Set("User-Agent", client.UserAgent())
×
40
        if client.username != nil && client.password != nil {
×
41
                bauth := fmt.Sprintf("%s:%s", *client.username, *client.password)
×
42
                bauth = base64.StdEncoding.EncodeToString([]byte(bauth))
×
43
                req.Header.Set("Authorization", fmt.Sprintf("Basic %s", bauth))
×
44
        }
×
45
        return client.sub.Do(req)
×
46
}
47

NEW
48
func (client *Client) UserAgent() string {
×
NEW
49
        return fmt.Sprintf("CTFer.io Victor (%s)", client.version)
×
NEW
50
}
×
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