Documentation
¶
Index ¶
- Constants
- type ConnectError
- type FCGIClient
- func (client *FCGIClient) Close()
- func (client *FCGIClient) Do(p map[string]string, req io.Reader) (r io.Reader, err error)
- func (client *FCGIClient) Get(p map[string]string) (resp *http.Response, err error)
- func (c *FCGIClient) Head(p map[string]string) (resp *http.Response, err error)
- func (c *FCGIClient) Options(p map[string]string) (resp *http.Response, err error)
- func (client *FCGIClient) Post(p map[string]string, bodyType string, body io.Reader, l int) (resp *http.Response, err error)
- func (client *FCGIClient) PostFile(p map[string]string, data url.Values, file map[string]string) (resp *http.Response, err error)
- func (client *FCGIClient) PostForm(p map[string]string, data url.Values) (resp *http.Response, err error)
- func (client *FCGIClient) Request(p map[string]string, req io.Reader) (resp *http.Response, err error)
- func (c *FCGIClient) SetReadTimeout(t time.Duration) error
- func (c *FCGIClient) SetWriteTimeout(t time.Duration) error
- type ReadRespHeaderError
- type Transport
- type WriteRequestError
Constants ¶
const ( // FCGIBeginRequest is the begin request flag. FCGIBeginRequest uint8 = iota + 1 // FCGIAbortRequest is the abort request flag. FCGIAbortRequest // FCGIEndRequest is the end request flag. FCGIEndRequest // FCGIParams is the parameters flag. FCGIParams // FCGIStdin is the standard input flag. FCGIStdin // FCGIStdout is the standard output flag. FCGIStdout // FCGIStderr is the standard error flag. FCGIStderr // FCGIData is the data flag. FCGIData // FCGIGetValues is the get values flag. FCGIGetValues // FCGIGetValuesResult is the get values result flag. FCGIGetValuesResult // FCGIUnknownType is the unknown type flag. FCGIUnknownType // FCGIMaxType is the maximum type flag. FCGIMaxType = FCGIUnknownType )
const ( // FCGIResponder is the responder flag. FCGIResponder uint8 = iota + 1 // FCGIAuthorizer is the authorizer flag. FCGIAuthorizer // FCGIFilter is the filter flag. FCGIFilter )
const ( // FCGIRequestComplete is the completed request flag. FCGIRequestComplete uint8 = iota // FCGICantMpxConn is the multiplexed connections flag. FCGICantMpxConn // FCGIOverLoaded is the overloaded flag. FCGIOverLoaded // FCGIUnknownRole is the unknown role flag. FCGIUnknownRole )
const ( // FCGIMaxConns is the maximum connections flag. FCGIMaxConns string = "MAX_CONNS" // FCGIMaxReqs is the maximum requests flag. FCGIMaxReqs string = "MAX_REQS" // FCGIMpxsConns is the multiplex connections flag. FCGIMpxsConns string = "MPXS_CONNS" )
const FCGIHeaderLen uint8 = 8
FCGIHeaderLen describes header length.
const FCGIKeepConn uint8 = 1
FCGIKeepConn describes keep connection mode.
const FCGIListenSockFileNo uint8 = 0
FCGIListenSockFileNo describes listen socket file number.
const FCGINullRequestID uint8 = 0
FCGINullRequestID describes the null request ID.
const Version1 uint8 = 1
Version1 describes the version.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConnectError ¶
func (ConnectError) Error ¶
func (e ConnectError) Error() string
type FCGIClient ¶
type FCGIClient struct {
// contains filtered or unexported fields
}
FCGIClient implements a FastCGI client, which is a standard for interfacing external applications with Web servers.
func Dial ¶
func Dial(network, address string) (fcgi *FCGIClient, err error)
Dial connects to the fcgi responder at the specified network address. See func net.Dial for a description of the network and address parameters.
func (*FCGIClient) Do ¶
Do made the request and returns a io.Reader that translates the data read from fcgi responder out of fcgi packet before returning it.
func (*FCGIClient) Post ¶
func (client *FCGIClient) Post(p map[string]string, bodyType string, body io.Reader, l int) (resp *http.Response, err error)
Post issues a Post request to the fcgi responder. with request body in the format that bodyType specified
func (*FCGIClient) PostFile ¶
func (client *FCGIClient) PostFile(p map[string]string, data url.Values, file map[string]string) (resp *http.Response, err error)
PostFile issues a POST to the fcgi 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 (*FCGIClient) PostForm ¶
func (client *FCGIClient) PostForm(p map[string]string, data url.Values) (resp *http.Response, err error)
PostForm issues a POST to the fcgi responder, with form as a string key to a list values (url.Values)
func (*FCGIClient) Request ¶
func (client *FCGIClient) Request(p map[string]string, req io.Reader) (resp *http.Response, err error)
Request returns a HTTP Response with Header and Body from fcgi responder
func (*FCGIClient) SetReadTimeout ¶
func (c *FCGIClient) SetReadTimeout(t time.Duration) error
SetReadTimeout sets the read timeout for future calls that read from the fcgi responder. A zero value for t means no timeout will be set.
func (*FCGIClient) SetWriteTimeout ¶
func (c *FCGIClient) SetWriteTimeout(t time.Duration) error
SetWriteTimeout sets the write timeout for future calls that send data to the fcgi responder. A zero value for t means no timeout will be set.
type ReadRespHeaderError ¶
type ReadRespHeaderError struct {
Err error
}
func (ReadRespHeaderError) Error ¶
func (e ReadRespHeaderError) Error() string
type Transport ¶
type Transport struct { // Root is the fastcgi root directory. Defaults to the root // directory of the parent virtual host. Root string // EnvVars is the extra environment variables. EnvVars map[string]string }
Transport facilitates FastCGI communication.
type WriteRequestError ¶
type WriteRequestError struct {
Err error
}
func (WriteRequestError) CheckTargetError ¶
func (e WriteRequestError) CheckTargetError(addr net.Addr) bool
func (WriteRequestError) Error ¶
func (e WriteRequestError) Error() string