http

package
v1.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 26, 2021 License: Apache-2.0 Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClientFactory

ClientFactory decorates the transport of the client generated by the received factory with a Transport

func PlainClientFormater

func PlainClientFormater(req interface{}, resp interface{}, err error) []byte

PlainClientFormater is a function that dumps the inspected data (at the client level) using the httputil lib

func PlainServerFormater

func PlainServerFormater(req interface{}, resp interface{}, err error) []byte

PlainServerFormater is a function that dumps the inspected data (at the router level) using the httputil lib

Types

type RunServerFunc

type RunServerFunc func(context.Context, config.ServiceConfig, http.Handler) error

RunServerFunc is the interface expected by all the KrakenD http routers

func RunServer

RunServer returns a wrapper over the received RunServerFunc so it can inject a decorated http.Handler and dump pairs of request and response using the generated dumper.

type Transport

type Transport struct {
	Transport http.RoundTripper
	Logger    logging.Logger
	Spew      spew.Dumper
	Plain     spew.Dumper
}

Transport is a wrapper over an instance of http.RoundTripper. It dumps every pair of request and response into two dumpers: one using the spew lib; the second using the httputil package from the standard lib

func (*Transport) RoundTrip

func (t *Transport) RoundTrip(req *http.Request) (resp *http.Response, err error)

RoundTrip takes a Request and returns a Response

It delegates the actual execution and it just dumps the request, the response and the possible error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL