Documentation ¶
Index ¶
- Constants
- Variables
- func CreateParams(params ...[]byte) [][]byte
- func GetNextIndex(startIndex int, segmentLength int, length int) (int, int, int)
- func Uint32ToBytes(buffer []byte, value uint32)
- type FCGIHeader
- type Fcgi
- func (fcgi *Fcgi) Close(conn *epollclient.Conn) error
- func (fcgi *Fcgi) Get(params [][]byte) (*epollclient.Conn, error)
- func (fcgi *Fcgi) GetConn() (*epollclient.Conn, error)
- func (fcgi *Fcgi) GetMultipartFormBoundary() []byte
- func (fcgi *Fcgi) Post(params [][]byte, content []byte) (*epollclient.Conn, error)
- func (fcgi *Fcgi) PostFile(params [][]byte, content []byte) (*epollclient.Conn, error)
- func (fcgi *Fcgi) PutConn(conn *epollclient.Conn)
- func (fcgi *Fcgi) Read(conn *epollclient.Conn, onRead OnReadEvent)
- func (fcgi *Fcgi) Reconnect(conn *epollclient.Conn) error
- func (fcgi *Fcgi) SetKeepAlive(n int)
- func (fcgi *Fcgi) Write(conn *epollclient.Conn, buffer []byte) (int, error)
- func (fcgi *Fcgi) WriteEndRequest(conn *epollclient.Conn, appStatus uint32, protocolStatus uint8) error
- func (fcgi *Fcgi) WriteFormData(conn *epollclient.Conn, content []byte, contentLength int) error
- func (fcgi *Fcgi) WriteMultipartFormData(conn *epollclient.Conn, content []byte, contentLength int) error
- func (fcgi *Fcgi) WriteMultipartFormFileContent(conn *epollclient.Conn, content []byte, name []byte, filename []byte) error
- func (fcgi *Fcgi) WriteMultipartFormFileEnd(conn *epollclient.Conn) error
- type FormData
- type ID
- type OnErrorEvent
- type OnReadEvent
- type OpCode
- type Record
Constants ¶
View Source
const ( FCGI_BEGIN_REQUEST uint8 = 1 FCGI_ABORT_REQUEST uint8 = 2 FCGI_END_REQUEST uint8 = 3 FCGI_PARAMS uint8 = 4 FCGI_STDIN uint8 = 5 FCGI_STDOUT uint8 = 6 FCGI_STDERR uint8 = 7 FCGI_DATA uint8 = 8 FCGI_GET_VALUES uint8 = 9 FCGI_GET_VALUES_RESULT uint8 = 10 FCGI_UNKNOWN_TYPE uint8 = 11 )
View Source
const ( FCGI_RESPONDER uint8 = 1 FCGI_AUTHORIZER uint8 = 2 FCGI_FILTER uint8 = 3 )
View Source
const ( FCGI_REQUEST_COMPLETE uint8 = 0 FCGI_CANT_MPX_CONN uint8 = 1 FCGI_OVERLOADED uint8 = 2 FCGI_UNKNOWN_ROLE uint8 = 3 )
View Source
const ( FCGI_MAX_CONNS string = "MAX_CONNS" FCGI_MAX_REQS string = "MAX_REQS" FCGI_MPXS_CONNS string = "MPXS_CONNS" )
View Source
const ( FCGI_DEFAULT_VERSION uint8 = 1 FCGI_KEEP_ALIVE uint8 = 1 )
View Source
const ( FCGI_HEADER_LENGTH int = 8 FCGI_HEADER_CONTENT_LENGTH int = FCGI_HEADER_LENGTH * 2 FCGI_CONTENT_LENGTH int = 65520 FCGI_PAD_LENGTH int = 255 FCGI_BUFFER_LENGTH int = FCGI_CONTENT_LENGTH + FCGI_HEADER_LENGTH + FCGI_PAD_LENGTH FCGI_MAX_ID uint16 = 65535 )
View Source
const (
DEFAULT_KEEP_ALIVE = 1
)
View Source
const (
HTTP_CONTENT_TYPE_LENGTH = 256
)
Variables ¶
View Source
var ( ErrorGetRequestId = errors.New("unable to get request id") ErrorInvalidFcgiVertion = errors.New("invalid fcgi version") )
View Source
var ( HTTP_CONTENT_TYPE = []byte("CONTENT_TYPE") HTTP_CONTENT_LENGTH = []byte("CONTENT_LENGTH") HTTP_CONTENT_TYPE_X_WWW_FORM = []byte("application/x-www-form-urlencoded") )
View Source
var ( HTTP_CONTENT_PREFIX = []byte("\r\nContent-Disposition: form-data; name=\"") HTTP_MULTIPART_FORM_DATA_PREFIX = []byte("multipart/form-data; boundary=") HTTP_MULTIPART_FORM_FILE_PREFIX = []byte("; filename=\"") HTTP_MULTIPART_FORM_CONTENT_TYPE_PREFIX = []byte("Content-Type: ") HTTP_MULTIPART_FORM_CONTENT_TYPE_OCTET_STREAM = []byte("application/octet-stream") DOUBLE_LINES = []byte("--") DOUBLE_QUOTES = []byte("\"") CRLF = []byte("\r\n") CRLF2 = []byte("\r\n\r\n") )
View Source
var ( AND_MARK = []byte("&") EQUAL_MARK = []byte("=") )
Functions ¶
func CreateParams ¶
func GetNextIndex ¶
func Uint32ToBytes ¶
Types ¶
type FCGIHeader ¶
type FCGIHeader struct {
// contains filtered or unexported fields
}
type Fcgi ¶
type Fcgi struct { OnError OnErrorEvent // contains filtered or unexported fields }
func (*Fcgi) GetMultipartFormBoundary ¶
func (*Fcgi) PutConn ¶
func (fcgi *Fcgi) PutConn(conn *epollclient.Conn)
func (*Fcgi) Read ¶
func (fcgi *Fcgi) Read(conn *epollclient.Conn, onRead OnReadEvent)
func (*Fcgi) SetKeepAlive ¶
func (*Fcgi) WriteEndRequest ¶
func (*Fcgi) WriteFormData ¶
func (*Fcgi) WriteMultipartFormData ¶
func (fcgi *Fcgi) WriteMultipartFormData(conn *epollclient.Conn, content []byte, contentLength int) error
content: k1=v1&k2=v2&k3=v3 ...
func (*Fcgi) WriteMultipartFormFileContent ¶
func (*Fcgi) WriteMultipartFormFileEnd ¶
func (fcgi *Fcgi) WriteMultipartFormFileEnd(conn *epollclient.Conn) error
type OnErrorEvent ¶
type OnErrorEvent func(conn *epollclient.Conn, err error)
Click to show internal directories.
Click to hide internal directories.