MCPcopy
hub / github.com/docker/compose / NewClient

Function NewClient

internal/desktop/client.go:82–95  ·  view source on GitHub ↗

NewClient creates a Desktop integration client for the provided in-memory socket address (AF_UNIX or named pipe).

(apiEndpoint string)

Source from the content-addressed store, hash-verified

80// NewClient creates a Desktop integration client for the provided in-memory
81// socket address (AF_UNIX or named pipe).
82func NewClient(apiEndpoint string) *Client {
83 var transport http.RoundTripper = &http.Transport{
84 DisableCompression: true,
85 DialContext: func(ctx context.Context, _, _ string) (net.Conn, error) {
86 return memnet.DialEndpoint(ctx, apiEndpoint)
87 },
88 }
89 transport = otelhttp.NewTransport(transport)
90
91 return &Client{
92 apiEndpoint: apiEndpoint,
93 client: &http.Client{Transport: transport},
94 }
95}
96
97func (c *Client) Endpoint() string {
98 return c.apiEndpoint

Callers 2

TestClientPingFunction · 0.85
IsFeatureActiveFunction · 0.85

Calls 1

DialEndpointFunction · 0.92

Tested by 1

TestClientPingFunction · 0.68