executor

package
v2.0.5 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2021 License: MIT Imports: 10 Imported by: 2

Documentation

Overview

Default implementation of executor.

In httransform Executor is something which does end processing of the given Context instance. It usually takes an HTTP request and fills HTTP response. It actually has to do that but in reality it can do much more, like request hijacking to support websockets or plain TCP upgrades.

So, Executor is a function which transforms HTTP request to HTTP response. And returns error if something goes wrong during that process.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Executor

type Executor func(*layers.Context) error

Executor transforms HTTP request to HTTP response and does some additional actions like management of connection upgrades.

func MakeDefaultExecutor

func MakeDefaultExecutor(dialer dialers.Dialer) Executor

MakeDefaultExecutor returns a default implementation of executor which does bare minimum:

1. It sends HTTP request, reads and returns HTTP response.

2. If request wants to upgrade connection (Connection: Upgrade), it hijacks a connection, returns a correct response and does TCP proxyfying of the sockets.

This function is created as a bare minimum to give end user the example on how to implementat his/her own executor.

Jump to

Keyboard shortcuts

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