Documentation
¶
Index ¶
Constants ¶
View Source
const ( MAXCONTENT = 65535 MAXPAD = 255 )
定义包的大小常量
contentlength用2个字节表示则最大为65535 paddinglenth 用1个字节表示则最大为255
View Source
const ( FCGI_BEGIN_REQUEST rctype = 1 FCGI_ABORT_REQUEST rctype = 2 FCGI_END_REQUEST rctype = 3 FCGI_PARAMS rctype = 4 FCGI_STDIN rctype = 5 FCGI_STDOUT rctype = 6 FCGI_STDERR rctype = 7 FCGI_DATA rctype = 8 FCGI_GET_VALUES rctype = 9 FCGI_GET_VALUES_RESULT rctype = 10 FCGI_UNKNOWN_TYPE rctype = 11 )
消息头类型定义
View Source
const ( ROLE_FCGI_RESPONSE = iota + 1 // 响应器 ROLE_FCGI_AUTHORIZER // 授权器 ROLE_FCGI_FILTER // 过滤器 )
角色
View Source
const ( FCGI_REQUEST_COMPLETE = iota FCGI_CANT_MPX_CONN FCGI_OVERLOADED FCGI_UNKNOW_ROLE )
请求完成描述
Variables ¶
View Source
var ErrConnClosed = errors.New("fcgi: connection to web server closed")
Functions ¶
Types ¶
type ConnChild ¶
type ConnChild struct {
// contains filtered or unexported fields
}
connChild
func NewConnChild ¶
func NewConnChild(conn io.ReadWriteCloser, handler http.Handler) *ConnChild
type FCGI_BeginRequestBody ¶
type FCGI_BeginRequestBody struct { Role uint16 // 角色,2字节 对应 RoleB1 RoleB0 Flags uint8 // 是否保持连接标记 Reserved [5]uint8 // 保留字段 }
ftype=1 消息体
type FCGI_Header ¶
type FCGI_Header struct { Version uint8 // 版本 Ftype rctype // 类型 RequestId uint16 // 请求ID, 两个字节 对应 RequestId1 和 RequestId0 ContentLength uint16 // 内容长度,两个字节 对应 ContentLengthB1 和 ContentLengthB0 PaddingLength uint8 // 填充字节的长度 Reserved uint8 // 保留字节 }
消息头结构体,8字节
type FcgiServer ¶
type FcgiServer struct {
// contains filtered or unexported fields
}
FcgiServer
func NewFcgiServer ¶
func NewFcgiServer(addr string, handler http.Handler) *FcgiServer
func (*FcgiServer) Start ¶
func (srv *FcgiServer) Start() error
type Request ¶
type Request struct {
// contains filtered or unexported fields
}
请求结构体
func (*Request) ParseParams ¶
func (req *Request) ParseParams()
解析key-value 0x220x33namea 0x220x33namea
type Response ¶
type Response struct {
// contains filtered or unexported fields
}
实现 ResponseWriter 接口
func NewResponse ¶
func (*Response) WriteHeader ¶
Click to show internal directories.
Click to hide internal directories.