Documentation
¶
Index ¶
- Constants
- func GetStdCtx(reqCtx *fasthttp.RequestCtx) context.Context
- type Backend
- type FastServer
- func (s *FastServer) Address() string
- func (s *FastServer) Listen() (net.Listener, error)
- func (s *FastServer) ListenPacket() (net.PacketConn, error)
- func (s *FastServer) Serve(ln net.Listener) error
- func (s *FastServer) ServePacket(net.PacketConn) error
- func (s *FastServer) Stop() error
- func (s *FastServer) WrapListener(ln net.Listener) net.Listener
- type GzipConfig
- type KVTuple
- type LocationMatcher
- type Middleware
- type NotFoundConfig
- type ServerConfig
- type StorageKey
- type Upstream
Constants ¶
View Source
const ( DurianName = "durian" DurianVersion = "0.0.1" )
View Source
const ( FastHTTPServerType = "fasthttp" RequestIDHeaderName = "rid" )
View Source
const ( LogMiddlewareName = "log" UUIDMiddlewareName = "uuid" RouterMiddlewareName = "router" )
View Source
const ( DirectiveProxy = "proxy" DirectiveHeader = "header" DirectiveTimeout = "timeout" DirectiveStatic = "static" DirectiveRewrite = "rewrite" DirectiveStatus = "status" DirectiveResponse = "response" DirectiveGzip = "gzip" DirectiveNotFound = "not_found" DirectiveLog = "log" DirectiveRouter = "router" DirectiveFastCgi = "fastcgi" DirectiveUpstream = "upstream" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type FastServer ¶
func NewFastServer ¶
func NewFastServer(cfg ServerConfig) *FastServer
func (*FastServer) Address ¶
func (s *FastServer) Address() string
func (*FastServer) ListenPacket ¶
func (s *FastServer) ListenPacket() (net.PacketConn, error)
func (*FastServer) ServePacket ¶
func (s *FastServer) ServePacket(net.PacketConn) error
func (*FastServer) Stop ¶
func (s *FastServer) Stop() error
func (*FastServer) WrapListener ¶
func (s *FastServer) WrapListener(ln net.Listener) net.Listener
type GzipConfig ¶
type LocationMatcher ¶
func NewCombineMatcher ¶
func NewCombineMatcher(shouldMatch LocationMatcher, exclude LocationMatcher) LocationMatcher
func NewLocationMatcher ¶
func NewLocationMatcher(firstLine []string) (LocationMatcher, error)
type Middleware ¶
type Middleware func(handler fasthttp.RequestHandler) fasthttp.RequestHandler
type NotFoundConfig ¶
type ServerConfig ¶
type ServerConfig struct {
Root string
Addr string
Name string
Concurrency int
DisableKeepalive bool
ReadBufferSize int
WriteBufferSize int
ReadTimeout time.Duration
WriteTimeout time.Duration
MaxConnsPerIP int
MaxRequestsPerConn int
MaxKeepaliveDuration time.Duration
TCPKeepalive bool
TCPKeepalivePeriod time.Duration
MaxRequestBodySize int
DisableHeaderNamesNormalizing bool
NoDefaultServerHeader bool
NoDefaultContentType bool
Gzip GzipConfig
NotFound NotFoundConfig
RequestIDName string
// contains filtered or unexported fields
}
ServerConfig stores the configuration for fasthttp.Server
func GetConfig ¶
func GetConfig(c *caddy.Controller) *ServerConfig
func (*ServerConfig) AddMiddleware ¶
func (cfg *ServerConfig) AddMiddleware(m Middleware)
func (*ServerConfig) AddNamedMiddleware ¶
func (cfg *ServerConfig) AddNamedMiddleware(name string, m Middleware)
type StorageKey ¶
type StorageKey int
const ( UpstreamKey StorageKey = iota ServerNameKey DocRootKey )
Click to show internal directories.
Click to hide internal directories.