Versions in this module Expand all Collapse all v0 v0.1.0 Feb 21, 2018 Changes in this version + func CopyWithBufferPool(source io.Reader, destination io.Writer, pool httputil.BufferPool) (int64, error) + func HttpFileRecorder(directory string, printStdOut bool) func(request *http.Request, response *http.Response) + func NewBytesBufferPool(poolSize, bufferSize int) httputil.BufferPool + func NewProxyHandler(proxyConfig *HttpBridgeProxyConfig, route *HttpBridgeProxyRoute) (http.Handler, error) + func NewProxyRecordingHandler(proxyConfig *HttpBridgeProxyConfig, route *HttpBridgeProxyRoute) (http.Handler, error) + func ReaderAsText(reader io.Reader) string + type HttpBridge struct + Config *HttpBridgeConfig + Handlers map[string]http.Handler + Server *http.Server + func NewHttpBridge(config *HttpBridgeConfig, factory HttpBridgeProxyHandlerFactory) (*HttpBridge, error) + func StartRecordingBridge(port string, outputDirectory string, routes ...*HttpBridgeProxyRoute) (*HttpBridge, error) + func (r *HttpBridge) ListenAndServe() error + func (r *HttpBridge) ListenAndServeTLS(certFile, keyFile string) error + type HttpBridgeConfig struct + Endpoint *HttpBridgeEndpointConfig + Proxy *HttpBridgeProxyConfig + Routes []*HttpBridgeProxyRoute + type HttpBridgeEndpointConfig struct + MaxHeaderBytes int + Port string + ReadTimeoutMs int + WriteTimeoutMs int + type HttpBridgeProxyConfig struct + BufferPoolSize int + BufferSize int + KeepAliveTimeMs int + MaxIdleConnections int + RequestTimeoutMs int + TLSHandshakeTimeoutMs int + type HttpBridgeProxyHandlerFactory func(proxyConfig *HttpBridgeProxyConfig, route *HttpBridgeProxyRoute) (http.Handler, error) + type HttpBridgeProxyRoute struct + Listener func(request *http.Request, response *http.Response) + Pattern string + ResponseModifier func(*http.Response) error + TargetURL *url.URL + type HttpRequest struct + Body string + Header http.Header + Method string + URL string + type HttpResponse struct + Body string + Code int + Header http.Header + type HttpTrip struct + Request *http.Request + func (w *HttpTrip) CloseNotify() <-chan bool + func (w *HttpTrip) Flush() + func (w *HttpTrip) Header() http.Header + func (w *HttpTrip) Response() *http.Response + func (w *HttpTrip) Write(b []byte) (int, error) + func (w *HttpTrip) WriteHeader(status int) + type ListeningTripHandler struct + func AsListeningTripHandler(handler http.Handler) *ListeningTripHandler + func NewListeningHandler(handler http.Handler, bufferPoolSize, bufferSize int, ...) *ListeningTripHandler + func (h *ListeningTripHandler) Notify(roundTrip *HttpTrip) + func (h ListeningTripHandler) ServeHTTP(responseWriter http.ResponseWriter, request *http.Request) + type RecordedHttpTrip struct + Request *HttpRequest + Response *HttpResponse + func ReadRecordedHttpTrips(directory string) ([]*RecordedHttpTrip, error)