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)
| 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. |
| 37 | func WithSpecificPorts(ports map[int]tunnels.TunnelPort) mockClientOpt { |
| 38 | return func(opts *mockClientOpts) { |
| 39 | opts.ports = ports |
| 40 | } |
| 41 | } |
| 42 | |
| 43 | func NewMockHttpClient(opts ...mockClientOpt) (*http.Client, error) { |
| 44 | mockClientOpts := &mockClientOpts{} |
no outgoing calls