Documentation ¶
Index ¶
- Variables
- func ApplyFromGin(ginEngine *gin.Engine)
- func ApplyToBeego(server *web.HttpServer)
- func ApplyToEcho(e *echo.Echo)
- func ApplyToGin(ginEngine *gin.Engine)
- func DELETE(path string, handle http.HandlerFunc, options ...workerOption)
- func GET(path string, handle http.HandlerFunc, options ...workerOption)
- func GetStat() map[string]*stat
- func HEAD(path string, handle http.HandlerFunc, options ...workerOption)
- func InstallFilterChanForBeego()
- func ListenAndServe(addr string) error
- func MiddlewareForEcho() echo.MiddlewareFunc
- func MiddlewareForGin() gin.HandlerFunc
- func New(conf *Config) *hrq
- func OPTIONS(path string, handle http.HandlerFunc, options ...workerOption)
- func PATCH(path string, handle http.HandlerFunc, options ...workerOption)
- func POST(path string, handle http.HandlerFunc, options ...workerOption)
- func PUT(path string, handle http.HandlerFunc, options ...workerOption)
- func Router() *httprouter.Router
- func SetGlobalHrq(h *hrq)
- func WithWorkerOption(workerCount int, maxQueue int) workerOption
- type Config
Constants ¶
This section is empty.
Variables ¶
View Source
var Conf = &Config{ Workers: runtime.NumCPU() * 10, MaxQueueSize: runtime.NumCPU() * 100, MaxConnection: 10000, TimeoutQueue: 3000, TempDir: "/tmp", EnableOverload: true, PerRequestQueue: runtime.NumCPU() * 10, PerRequestWorker: runtime.NumCPU() * 5, workerOptions: make(map[string]workerOption), }
Functions ¶
func ApplyFromGin ¶
func ApplyToBeego ¶
func ApplyToBeego(server *web.HttpServer)
func ApplyToEcho ¶
func ApplyToEcho(e *echo.Echo)
func ApplyToGin ¶
func DELETE ¶
func DELETE(path string, handle http.HandlerFunc, options ...workerOption)
DELETE is a shortcut for router.Handle(http.MethodDelete, path, handle)
func GET ¶
func GET(path string, handle http.HandlerFunc, options ...workerOption)
func HEAD ¶
func HEAD(path string, handle http.HandlerFunc, options ...workerOption)
HEAD is a shortcut for router.Handle(http.MethodHead, path, handle)
func InstallFilterChanForBeego ¶
func InstallFilterChanForBeego()
func ListenAndServe ¶
func MiddlewareForEcho ¶
func MiddlewareForEcho() echo.MiddlewareFunc
func MiddlewareForGin ¶
func MiddlewareForGin() gin.HandlerFunc
func OPTIONS ¶
func OPTIONS(path string, handle http.HandlerFunc, options ...workerOption)
OPTIONS is a shortcut for router.Handle(http.MethodOptions, path, handle)
func PATCH ¶
func PATCH(path string, handle http.HandlerFunc, options ...workerOption)
PATCH is a shortcut for router.Handle(http.MethodPatch, path, handle)
func POST ¶
func POST(path string, handle http.HandlerFunc, options ...workerOption)
POST is a shortcut for router.Handle(http.MethodPost, path, handle)
func PUT ¶
func PUT(path string, handle http.HandlerFunc, options ...workerOption)
PUT is a shortcut for router.Handle(http.MethodPut, path, handle)
func Router ¶
func Router() *httprouter.Router
func WithWorkerOption ¶
Types ¶
type Config ¶
type Config struct { // The number of goroutines that will be used to handle requests. // If <= 0, then the number of CPUs will be used. Workers int // The size of the queue that will be used to store requests. // If <= 0, then the default value will be used. MaxQueueSize int // TempDir is the directory to use for temporary files. TempDir string // TimeoutQueue is the maximum duration before timing out read of the request. // If TimeoutQueue is zero, no timeout is set. TimeoutQueue int64 // TimeoutProcess is the maximum duration before timing out processing of the request. // If TimeoutProcess is zero, no timeout is set. TimeoutProcess int64 PerRequestWorker int PerRequestQueue int // MaxConnection MaxConnection int // enable overload EnableOverload bool // contains filtered or unexported fields }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.