Documentation ¶
Index ¶
- type SCGIClient
- func (c *SCGIClient) Close()
- func (c *SCGIClient) Do(p map[string]string, req io.Reader) (r io.Reader, err error)
- func (c *SCGIClient) Get(p map[string]string, body io.Reader, l int64) (resp *http.Response, err error)
- func (c *SCGIClient) Head(p map[string]string) (resp *http.Response, err error)
- func (c *SCGIClient) Options(p map[string]string) (resp *http.Response, err error)
- func (c *SCGIClient) Post(p map[string]string, method string, bodyType string, body io.Reader, l int64) (resp *http.Response, err error)
- func (c *SCGIClient) PostFile(p map[string]string, data url.Values, file map[string]string) (resp *http.Response, err error)
- func (c *SCGIClient) PostForm(p map[string]string, data url.Values) (resp *http.Response, err error)
- func (c *SCGIClient) Request(p map[string]string, req io.Reader) (resp *http.Response, err error)
- func (c *SCGIClient) SetReadTimeout(t time.Duration) error
- func (c *SCGIClient) SetWriteTimeout(t time.Duration) error
- type Transport
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SCGIClient ¶
type SCGIClient struct {
// contains filtered or unexported fields
}
SCGIClient implements a SCGI client, which is a standard for interfacing external applications with Web servers.
func Dial ¶
func Dial(network, address string) (scgi *SCGIClient, err error)
Dial connects to the scgi responder at the specified network address, using default net.Dialer. See func net.Dial for a description of the network and address parameters.
func DialContext ¶
func DialContext(ctx context.Context, network, address string) (scgi *SCGIClient, err error)
DialContext is like Dial but passes ctx to dialer.Dial.
func DialWithDialerContext ¶
func DialWithDialerContext(ctx context.Context, network, address string, dialer net.Dialer) (scgi *SCGIClient, err error)
DialWithDialerContext connects to the scgi responder at the specified network address, using custom net.Dialer and a context. See func net.Dial for a description of the network and address parameters.
func (*SCGIClient) Do ¶
Do made the request and returns a io.Reader that translates the data read from scgi responder out of scgi packet before returning it.
func (*SCGIClient) Get ¶
func (c *SCGIClient) Get(p map[string]string, body io.Reader, l int64) (resp *http.Response, err error)
Get issues a GET request to the scgi responder.
func (*SCGIClient) Options ¶ added in v0.2.0
Options issues an OPTIONS request to the scgi responder.
func (*SCGIClient) Post ¶
func (c *SCGIClient) Post(p map[string]string, method string, bodyType string, body io.Reader, l int64) (resp *http.Response, err error)
Post issues a POST request to the scgi responder. with request body in the format that bodyType specified
func (*SCGIClient) PostFile ¶ added in v0.2.0
func (c *SCGIClient) PostFile(p map[string]string, data url.Values, file map[string]string) (resp *http.Response, err error)
PostFile issues a POST to the scgi responder in multipart(RFC 2046) standard, with form as a string key to a list values (url.Values), and/or with file as a string key to a list file path.
func (*SCGIClient) PostForm ¶ added in v0.2.0
func (c *SCGIClient) PostForm(p map[string]string, data url.Values) (resp *http.Response, err error)
PostForm issues a POST to the scgi responder, with form as a string key to a list values (url.Values)
func (*SCGIClient) Request ¶
Request returns a HTTP Response with Header and Body from scgi responder
func (*SCGIClient) SetReadTimeout ¶
func (c *SCGIClient) SetReadTimeout(t time.Duration) error
SetReadTimeout sets the read timeout for future calls that read from the scgi responder. A zero value for t means no timeout will be set.
func (*SCGIClient) SetWriteTimeout ¶
func (c *SCGIClient) SetWriteTimeout(t time.Duration) error
SetWriteTimeout sets the write timeout for future calls that send data to the scgi responder. A zero value for t means no timeout will be set.
type Transport ¶
type Transport struct { // Extra environment variables. EnvVars map[string]string `json:"env,omitempty"` // The duration used to set a deadline when connecting to an upstream. Default: `3s`. DialTimeout caddy.Duration `json:"dial_timeout,omitempty"` // The duration used to set a deadline when reading from the SCGI server. ReadTimeout caddy.Duration `json:"read_timeout,omitempty"` // The duration used to set a deadline when sending to the SCGI server. WriteTimeout caddy.Duration `json:"write_timeout,omitempty"` // contains filtered or unexported fields }
Transport facilitates SCGI communication.
func (Transport) CaddyModule ¶
func (Transport) CaddyModule() caddy.ModuleInfo
CaddyModule returns the Caddy module information.