Documentation ¶
Index ¶
- func NewNoopLogger() echo.Logger
- type Option
- func WithContextFiller(contextFillers ...fillcontext.Filler) Option
- func WithCookieKeys(hashKey, blockKey []byte) Option
- func WithRedirectToHTTPS(from, to int) Option
- func WithRedirectToHost(target string) Option
- func WithStatic(mount string, searchPaths ...string) Option
- func WithTrustedProxies(cidrs ...string) Option
- type Registerer
- type Server
- func (s *Server) APIRouter() *mux.Router
- func (s *Server) DELETE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
- func (s *Server) GET(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
- func (s *Server) Group(prefix string, middleware ...echo.MiddlewareFunc) *echo.Group
- func (s *Server) HEAD(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
- func (s *Server) POST(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
- func (s *Server) Prefix(prefix string) *mux.Route
- func (s *Server) RootRouter() *mux.Router
- func (s *Server) Router() *mux.Router
- func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (s *Server) Static(prefix string, fs http.FileSystem)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewNoopLogger ¶
NewNoopLogger returns an echo.Logger that discards all log messages.
Types ¶
type Option ¶
type Option func(*options)
Option for the web server
func WithContextFiller ¶
func WithContextFiller(contextFillers ...fillcontext.Filler) Option
WithContextFiller sets context fillers that are executed on every request context.
func WithCookieKeys ¶
WithCookieKeys sets the cookie hash key and block key.
func WithRedirectToHTTPS ¶
WithRedirectToHTTPS redirects HTTP requests to HTTPS.
func WithRedirectToHost ¶
WithRedirectToHost redirects all requests to this host.
func WithStatic ¶
WithStatic sets the mount and search paths for static assets.
func WithTrustedProxies ¶
WithTrustedProxies adds trusted proxies from which proxy headers are trusted.
type Registerer ¶
type Registerer interface {
RegisterRoutes(s *Server)
}
Registerer allows components to register their services to the web server.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is the server.
func (*Server) DELETE ¶
func (s *Server) DELETE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
DELETE registers a DELETE handler at path.
func (*Server) GET ¶
func (s *Server) GET(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
GET registers a GET handler at path.
func (*Server) HEAD ¶
func (s *Server) HEAD(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
HEAD registers a HEAD handler at path.
func (*Server) POST ¶
func (s *Server) POST(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
POST registers a POST handler at path.
func (*Server) RootRouter ¶
RootRouter returns the root router. In most cases the Router() should be used instead of the root router.