MCPcopy Create free account
hub / github.com/cli/cli / WithSpecificPorts

Function WithSpecificPorts

internal/codespaces/connection/tunnels_api_server_mock.go:37–41  ·  view source on GitHub ↗

WithSpecificPorts allows you to specify a map of ports to TunnelPorts that will be returned by the mock HTTP client. Note that this does not take a copy of the map, so you should not modify the map after passing it to this function.

(ports map[int]tunnels.TunnelPort)

Source from the content-addressed store, hash-verified

35// WithSpecificPorts allows you to specify a map of ports to TunnelPorts that will be returned by the mock HTTP client.
36// Note that this does not take a copy of the map, so you should not modify the map after passing it to this function.
37func WithSpecificPorts(ports map[int]tunnels.TunnelPort) mockClientOpt {
38 return func(opts *mockClientOpts) {
39 opts.ports = ports
40 }
41}
42
43func NewMockHttpClient(opts ...mockClientOpt) (*http.Client, error) {
44 mockClientOpts := &mockClientOpts{}

Callers 1

Calls

no outgoing calls

Tested by 1