Documentation ¶
Index ¶
- func WrapHTTPHeader(headers http.Header) api.HeaderMap
- func WrapHTTPRequest(req *http.Request) api.HTTPRequest
- func WrapHTTPResponse(resp *http.Response) api.HTTPResponse
- type HTTPRequest
- func (r *HTTPRequest) Body() io.ReadCloser
- func (r *HTTPRequest) Connection() network.Connection
- func (r *HTTPRequest) HTTPProtocol() string
- func (r *HTTPRequest) Header() api.HeaderMap
- func (r *HTTPRequest) Host() string
- func (r *HTTPRequest) Method() string
- func (r *HTTPRequest) SetBody(body io.ReadCloser)
- func (r *HTTPRequest) Trailer() api.HeaderMap
- func (r *HTTPRequest) URL() *url.URL
- type HTTPResponse
- func (r *HTTPResponse) Body() io.ReadCloser
- func (r *HTTPResponse) Connection() network.Connection
- func (r *HTTPResponse) ContentLength() int64
- func (r *HTTPResponse) GetHTTPResponse() *http.Response
- func (r *HTTPResponse) Header() api.HeaderMap
- func (r *HTTPResponse) SetBody(body io.ReadCloser)
- func (r *HTTPResponse) StatusCode() int
- func (r *HTTPResponse) Trailer() api.HeaderMap
- type HTTPTransport
- type HandleMiddleware
- type Handler
- type MiddlewareHandler
- type Middlewares
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WrapHTTPRequest ¶
func WrapHTTPRequest(req *http.Request) api.HTTPRequest
func WrapHTTPResponse ¶
func WrapHTTPResponse(resp *http.Response) api.HTTPResponse
Types ¶
type HTTPRequest ¶
func (*HTTPRequest) Body ¶
func (r *HTTPRequest) Body() io.ReadCloser
func (*HTTPRequest) Connection ¶
func (r *HTTPRequest) Connection() network.Connection
func (*HTTPRequest) HTTPProtocol ¶
func (r *HTTPRequest) HTTPProtocol() string
func (*HTTPRequest) Header ¶
func (r *HTTPRequest) Header() api.HeaderMap
func (*HTTPRequest) Host ¶
func (r *HTTPRequest) Host() string
func (*HTTPRequest) Method ¶
func (r *HTTPRequest) Method() string
func (*HTTPRequest) SetBody ¶
func (r *HTTPRequest) SetBody(body io.ReadCloser)
func (*HTTPRequest) Trailer ¶
func (r *HTTPRequest) Trailer() api.HeaderMap
func (*HTTPRequest) URL ¶
func (r *HTTPRequest) URL() *url.URL
type HTTPResponse ¶
func (*HTTPResponse) Body ¶
func (r *HTTPResponse) Body() io.ReadCloser
func (*HTTPResponse) Connection ¶
func (r *HTTPResponse) Connection() network.Connection
func (*HTTPResponse) ContentLength ¶
func (r *HTTPResponse) ContentLength() int64
func (*HTTPResponse) GetHTTPResponse ¶
func (r *HTTPResponse) GetHTTPResponse() *http.Response
func (*HTTPResponse) Header ¶
func (r *HTTPResponse) Header() api.HeaderMap
func (*HTTPResponse) SetBody ¶
func (r *HTTPResponse) SetBody(body io.ReadCloser)
func (*HTTPResponse) StatusCode ¶
func (r *HTTPResponse) StatusCode() int
func (*HTTPResponse) Trailer ¶
func (r *HTTPResponse) Trailer() api.HeaderMap
type HTTPTransport ¶
type HTTPTransport struct { MiddlewareHandler // contains filtered or unexported fields }
func NewHTTPTransport ¶
func NewHTTPTransport(transport http.RoundTripper, streamHandler api.StreamHandler, logger logr.Logger) *HTTPTransport
func (*HTTPTransport) Logger ¶
func (t *HTTPTransport) Logger() logr.Logger
type HandleMiddleware ¶
type HandleMiddleware interface { BeforeRequest(req api.HTTPRequest, stream api.Stream) AfterRequest(req api.HTTPRequest, stream api.Stream) BeforeResponse(resp api.HTTPResponse, stream api.Stream) AfterResponse(resp api.HTTPResponse, stream api.Stream) }
type Handler ¶
type Handler interface { http.Handler Logger() logr.Logger AddMiddleware(middleware HandleMiddleware) RemoveMiddleware(middleware HandleMiddleware) }
func NewHandler ¶
func NewHandler(handler http.Handler, streamHandler api.StreamHandler, direction api.ListenerDirection) Handler
type MiddlewareHandler ¶
type MiddlewareHandler interface { HandleMiddleware AddMiddleware(middleware HandleMiddleware) RemoveMiddleware(middleware HandleMiddleware) GetMiddlewares() Middlewares }
func NewMiddlewareHandler ¶
func NewMiddlewareHandler() MiddlewareHandler
type Middlewares ¶
type Middlewares map[HandleMiddleware]struct{}
Click to show internal directories.
Click to hide internal directories.