Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Transport ¶
type Transport struct { Underlying http.RoundTripper Debug bool }
Transport intercepts HTTP requests and re-writes them according to bind.HTTP's local port binds. This is done to provide an shared http.RoundTripper usable by clients wishing for local dev with Moov.
The underlying http.RoundTripper is required to enforce timeouts and other config be non-default and so we don't hack into http.DefaultClient (which has no timeouts).
func (*Transport) RoundTrip ¶
RoundTrip modifies the incoming request to reshape a Moov API production URL to a local dev URL. The GoDoc for http.RoundTripper state that the request SHOULD not be modified, not MUST. If this ends up causing problems we'll have to figure out another solution.
This means:
- Dropping /v1/$app routing prefix
- Changing the local port used (each app runs on its own port now)
- Adjusting the scheme if needed.