Versions in this module Expand all Collapse all v0 v0.2.0 Jul 4, 2020 Changes in this version + type RequestFunc func(r *http.Request) + type ResponseFunc func(r *http.Response) type TunnelOption + func RequestHook(before ...RequestFunc) TunnelOption + func ResponseHook(after ...ResponseFunc) TunnelOption v0.1.0 Jul 3, 2020 Changes in this version + const ContextKeySessionID + const ContextKeyStreamReader + const ContextKeyStreamWriter + const DefaultHTTPTimeout + const DefaultReTryCount + var ErrStreamReaderNotDefined = errors.New("httptunnel: stream reader not defined") + var ErrStreamWriterNotDefined = errors.New("httptunnel: stream writer not defined") + func WithSession(ctx context.Context, sessionID uuid.UUID) context.Context + type Client struct + func NewClient(w wirenet.Wire, streamName string, options ...ClientOption) *Client + func (c *Client) Do(req *http.Request) (resp *http.Response, err error) + func (c *Client) WithTx(ctx context.Context, sessionID uuid.UUID, ...) error + type ClientOption func(c *Client) + func SetReadResponse(r ReadResponse) ClientOption + type ErrorHandler interface + Handle func(ctx context.Context, err error) + type ErrorHandlerFunc func(ctx context.Context, err error) + func (f ErrorHandlerFunc) Handle(ctx context.Context, err error) + type LogErrorHandler struct + func NewLogErrorHandler() *LogErrorHandler + func (h *LogErrorHandler) Handle(ctx context.Context, err error) + type ReadRequest func(*bufio.Reader) (*http.Request, error) + type ReadResponse func(*bufio.Reader, *http.Request) (*http.Response, error) + type Tunnel struct + func New(options ...TunnelOption) *Tunnel + func (tunnel Tunnel) Handle(ctx context.Context, stream wirenet.Stream) + type TunnelOption func(tunnel *Tunnel) + func SetClient(client httpclient.Client) TunnelOption + func SetReadRequest(r ReadRequest) TunnelOption + func SetTunnelErrorHandler(errorHandler ErrorHandler) TunnelOption