Documentation ¶
Index ¶
- Constants
- Variables
- func GetHTTPRequest(req []byte) (httpReq *http.Request, err error)
- func NewRawHTTPResponse(status int, contentType string, body []byte) (res []byte)
- func SetHTTPStringFormat(format string)
- type Conn
- type ConnInfo
- type DataHandlerFunc
- type Ev
- type Queue
- type TickHandlerFunc
- type UnexpectedDisconnectionFunc
Constants ¶
View Source
const ( DefaultTickDelayDuration = time.Millisecond * 100 InternalServerErrorMessage = "Internal server error: %s" BadRequestErrorMessage = "Bad request: %s" ContentTypeTextPlain = "text/plain" Separator = "\r\n\r\n" )
View Source
const (
MinimumHTTPStringFormat = "" /* 137-byte string literal not displayed */
)
Variables ¶
View Source
var ( ErrorMalformedBody = errors.New("Malformed request body") ErrorMalformedHeader = errors.New("Malformed request header") ContentLengthRegexp = regexp.MustCompile("Content-Length: ([0-9]+)") HostPortOnlyRegexp = regexp.MustCompile("^:[0-9]{1,5}$") )
View Source
var (
HTTPStringFormat = MinimumHTTPStringFormat
)
Functions ¶
func NewRawHTTPResponse ¶
func SetHTTPStringFormat ¶
func SetHTTPStringFormat(format string)
Types ¶
type DataHandlerFunc ¶
type DataHandlerFunc func(connInfo *ConnInfo)
type Ev ¶
type Ev struct { Server evio.Server Conn Conn Host string DataHandler DataHandlerFunc TickHandler TickHandlerFunc UnexpectedDisconnectionHandler UnexpectedDisconnectionFunc // contains filtered or unexported fields }
func New ¶
func New(host string, dataHandler DataHandlerFunc, tickHandler TickHandlerFunc, unexpectedDisconnectionHandler UnexpectedDisconnectionFunc) *Ev
type TickHandlerFunc ¶
type UnexpectedDisconnectionFunc ¶
type UnexpectedDisconnectionFunc func(connInfo *ConnInfo)
Click to show internal directories.
Click to hide internal directories.