MCPcopy Index your code
hub / github.com/ProspectOne/perfops-cli / WithHTTPClient

Function WithHTTPClient

perfops/client.go:98–106  ·  view source on GitHub ↗

WithHTTPClient sets the HTTP client for the API client.

(client *http.Client)

Source from the content-addressed store, hash-verified

96
97// WithHTTPClient sets the HTTP client for the API client.
98func WithHTTPClient(client *http.Client) func(c *Client) error {
99 return func(c *Client) error {
100 if client == nil {
101 return errors.New("HTTP client is nil")
102 }
103 c.client = client
104 return nil
105 }
106}
107
108// NewClient returns a new Client given an API key and options.
109func NewClient(opts ...func(c *Client) error) (*Client, error) {

Callers 3

newTestPerfopsClientFunction · 0.92
TestNewClientFunction · 0.85
newTestClientFunction · 0.85

Calls

no outgoing calls

Tested by 3

newTestPerfopsClientFunction · 0.74
TestNewClientFunction · 0.68
newTestClientFunction · 0.68