Documentation
¶
Index ¶
- func NewContentHandler(cfg tree.Map, _ logger.Logger) (fasthttp.RequestHandler, error)
- func NewExpvarHandler(cfg tree.Map, l logger.Logger) (fasthttp.RequestHandler, error)
- func NewFS(cfg tree.Map) (*fasthttp.FS, error)
- func NewFSHandler(cfg tree.Map, l logger.Logger) (fasthttp.RequestHandler, error)
- func NewHandler(cfg tree.Map, l logger.Logger) (fasthttp.RequestHandler, error)
- func NewProxyHandler(cfg tree.Map, l logger.Logger) (fasthttp.RequestHandler, error)
- func RegisterNewHandlerFunc(t string, fn NewHandlerFunc)
- type Content
- type ErrorPages
- type NewHandlerFunc
- type ProxyHandler
- type ServerHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewContentHandler ¶ added in v0.3.3
func NewExpvarHandler ¶ added in v0.3.3
NewExpvarHandler returns a ExpvarHandler that dumps json representation of expvars to http response. Refer to https://github.com/valyala/fasthttp/tree/master/expvarhandler
func NewFSHandler ¶
func NewHandler ¶
func NewProxyHandler ¶
func RegisterNewHandlerFunc ¶
func RegisterNewHandlerFunc(t string, fn NewHandlerFunc)
Types ¶
type Content ¶ added in v0.3.3
type Content struct {
// contains filtered or unexported fields
}
func NewContent ¶ added in v0.3.3
func (*Content) Handle ¶ added in v0.3.3
func (h *Content) Handle(ctx *fasthttp.RequestCtx)
type ErrorPages ¶
type ErrorPages struct {
// contains filtered or unexported fields
}
func NewErrorPages ¶
func NewErrorPages(root string, cfg map[string]string) *ErrorPages
func (*ErrorPages) Handle ¶
func (p *ErrorPages) Handle(ctx *fasthttp.RequestCtx)
type NewHandlerFunc ¶
type ProxyHandler ¶
type ProxyHandler struct {
URL string
}
type ServerHandler ¶ added in v0.3.3
type ServerHandler interface {
// Config returns the config.Config.Server.
Config() tree.Map
// Logger returns a logger.
Logger() logger.Logger
// Handle handles the provided request.
Handle(ctx *fasthttp.RequestCtx)
// HandleError implements fasthttp.Server.ErrorHandler.
HandleError(ctx *fasthttp.RequestCtx, err error)
// Close closes the server.
Close() error
}
ServerHandler is an interface that defines the methods to handle a server.
func NewServerHandler ¶ added in v0.3.3
func NewServerHandler(cfgs []config.Config) (ServerHandler, error)
NewServerHandler creates a new ServerHandler by the provided cfgs.
Click to show internal directories.
Click to hide internal directories.