Documentation
¶
Index ¶
- type Config
- type Server
- func (self *Server) Endpoint(httpMethod string, path string) *endpoint.Endpoint
- func (self Server) Execute(fasthttpCtx *fasthttp.RequestCtx) (int, []byte)
- func (self *Server) Handle(endpointConfig *endpoint.Config, httpMethod string, path string, ...)
- func (self *Server) HandleNotFound(endpointConfig *endpoint.Config, handler endpoint.Handler)
- func (self Server) Listen()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Host string
Port int
ReadTimeout time.Duration
WriteTimeout time.Duration
LogConfig log.Configer
EnablePprof bool
}
Config top level options. These options can be altered per endpoint, if desired.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server listens for incoming requests and routes them to the registered endpoint handlers.
func (Server) Execute ¶
func (self Server) Execute(fasthttpCtx *fasthttp.RequestCtx) (int, []byte)
Execute one request. Useful for testing.
func (*Server) Handle ¶
func (self *Server) Handle(endpointConfig *endpoint.Config, httpMethod string, path string, handler endpoint.Handler)
Handle the given route to the provided endpoint handler. This starts a builder pattern where the endpoint may be modified from the root endpoint configuration.
func (*Server) HandleNotFound ¶
Click to show internal directories.
Click to hide internal directories.