MCPcopy Create free account
hub / github.com/rabbitstack/fibratus / WithTransport

Function WithTransport

pkg/util/rest/rest.go:46–59  ·  view source on GitHub ↗

WithTransport sets the preferred transport for the HTTP client.

(addr string)

Source from the content-addressed store, hash-verified

44
45// WithTransport sets the preferred transport for the HTTP client.
46func WithTransport(addr string) Option {
47 return func(o *opts) {
48 o.addr = addr
49 if strings.HasPrefix(addr, `npipe:///`) {
50 transport = &http.Transport{
51 DialContext: api.DialPipe(addr),
52 }
53 } else {
54 transport = &http.Transport{
55 DialContext: (&net.Dialer{}).DialContext,
56 }
57 }
58 }
59}
60
61// WithURI initializes the URI where the request is sent.
62func WithURI(uri string) Option {

Callers 4

statsFunction · 0.92
printConfigFunction · 0.92
TestGetFunction · 0.85
TestGetPipeFunction · 0.85

Calls 1

DialPipeFunction · 0.92

Tested by 2

TestGetFunction · 0.68
TestGetPipeFunction · 0.68