MCPcopy Index your code
hub / github.com/DoNewsCode/core / NewClient

Function NewClient

clihttp/client.go:59–71  ·  view source on GitHub ↗

NewClient creates a Client with tracing support.

(tracer opentracing.Tracer, options ...Option)

Source from the content-addressed store, hash-verified

57
58// NewClient creates a Client with tracing support.
59func NewClient(tracer opentracing.Tracer, options ...Option) *Client {
60 baseClient := &http.Client{Transport: &nethttp.Transport{}}
61 c := &Client{
62 tracer: tracer,
63 underlying: baseClient,
64 requestLogThreshold: 5000,
65 responseLogThreshold: 5000,
66 }
67 for _, f := range options {
68 f(c)
69 }
70 return c
71}
72
73// Do sends the request.
74func (c *Client) Do(req *http.Request) (*http.Response, error) {

Callers 6

ProvidersFunction · 0.85
TestClient_DoFunction · 0.85
TestClient_OptionFunction · 0.85
TestClient_raceFunction · 0.85
TestClient_contextFunction · 0.85
ExampleFunction · 0.85

Calls

no outgoing calls

Tested by 5

TestClient_DoFunction · 0.68
TestClient_OptionFunction · 0.68
TestClient_raceFunction · 0.68
TestClient_contextFunction · 0.68
ExampleFunction · 0.68