fastcgi

package module
v0.0.0-...-bee08ed Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2025 License: Apache-2.0 Imports: 22 Imported by: 0

README

Go Caddy FastCGI client

Repackaging of Caddy's FastCGI client code, under the same Apache 2 license.

Original code: github.com/caddyserver/caddy

Documentation

Index

Constants

View Source
const (
	// BeginRequest is the begin request flag.
	BeginRequest uint8 = iota + 1
	// AbortRequest is the abort request flag.
	AbortRequest
	// EndRequest is the end request flag.
	EndRequest
	// Params is the parameters flag.
	Params
	// Stdin is the standard input flag.
	Stdin
	// Stdout is the standard output flag.
	Stdout
	// Stderr is the standard error flag.
	Stderr
	// Data is the data flag.
	Data
	// GetValues is the get values flag.
	GetValues
	// GetValuesResult is the get values result flag.
	GetValuesResult
	// UnknownType is the unknown type flag.
	UnknownType
	// MaxType is the maximum type flag.
	MaxType = UnknownType
)
View Source
const (
	// Responder is the responder flag.
	Responder uint8 = iota + 1
	// Authorizer is the authorizer flag.
	Authorizer
	// Filter is the filter flag.
	Filter
)
View Source
const (
	// RequestComplete is the completed request flag.
	RequestComplete uint8 = iota
	// CantMultiplexConns is the multiplexed connections flag.
	CantMultiplexConns
	// Overloaded is the overloaded flag.
	Overloaded
	// UnknownRole is the unknown role flag.
	UnknownRole
)
View Source
const (
	// MaxConns is the maximum connections flag.
	MaxConns string = "MAX_CONNS"
	// MaxRequests is the maximum requests flag.
	MaxRequests string = "MAX_REQS"
	// MultiplexConns is the multiplex connections flag.
	MultiplexConns string = "MPXS_CONNS"
)
View Source
const FCGIHeaderLen uint8 = 8

FCGIHeaderLen describes header length.

View Source
const FCGIKeepConn uint8 = 1

FCGIKeepConn describes keep connection mode.

View Source
const FCGIListenSockFileno uint8 = 0

FCGIListenSockFileno describes listen socket file number.

View Source
const FCGINullRequestID uint8 = 0

FCGINullRequestID describes the null request ID.

View Source
const Version1 uint8 = 1

Version1 describes the version.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(ctx context.Context, params ClientParams) (*Client, error)

func (*Client) Close

func (c *Client) Close() error

func (*Client) Request

func (c *Client) Request(p map[string]string, req io.Reader) (resp *http.Response, err error)

type ClientParams

type ClientParams struct {
	Network string // defaults to "tcp"
	Address string
	Dialer  *net.Dialer // defaults to net.Dialer{}
}

type HandlerError

type HandlerError struct {
	Err        error // the original error value and message
	StatusCode int   // the HTTP status code to associate with this error

	ID    string // generated; for identifying this error in logs
	Trace string // produced from call stack
}

HandlerError is a serializable representation of an error from within an HTTP handler.

func Error

func Error(statusCode int, err error) HandlerError

Error is a convenient way for a Handler to populate the essential fields of a HandlerError. If err is itself a HandlerError, then any essential fields that are not set will be populated.

func (HandlerError) Error

func (e HandlerError) Error() string

func (HandlerError) Unwrap

func (e HandlerError) Unwrap() error

Unwrap returns the underlying error value. See the `errors` package for info.

Jump to

Keyboard shortcuts

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