Documentation ¶
Index ¶
- func GetLogger(r *http.Request) logrus.FieldLogger
- func GetLoggerOrDefault(r *http.Request, l logrus.FieldLogger) logrus.FieldLogger
- func Wrap(h http.Handler, middlewares ...negroni.Handler) http.Handler
- func WrapF(h http.HandlerFunc, middlewares ...negroni.Handler) http.Handler
- type BaseURL
- type Route
- type Router
- func (r *Router) Add(routes ...Route) *Router
- func (r *Router) Delete(path string, handler http.Handler) *Router
- func (r *Router) DeleteF(path string, handler http.HandlerFunc) *Router
- func (r *Router) Get(path string, handler http.Handler) *Router
- func (r *Router) GetF(path string, handler http.HandlerFunc) *Router
- func (r *Router) Handle(method, path string, handler http.Handler) *Router
- func (r *Router) Handler() http.Handler
- func (r *Router) Head(path string, handler http.Handler) *Router
- func (r *Router) HeadF(path string, handler http.HandlerFunc) *Router
- func (r *Router) Patch(path string, handler http.Handler) *Router
- func (r *Router) PatchF(path string, handler http.HandlerFunc) *Router
- func (r *Router) Post(path string, handler http.Handler) *Router
- func (r *Router) PostF(path string, handler http.HandlerFunc) *Router
- func (r *Router) Put(path string, handler http.Handler) *Router
- func (r *Router) PutF(path string, handler http.HandlerFunc) *Router
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetLogger ¶
func GetLogger(r *http.Request) logrus.FieldLogger
GetLogger returns the logger from the request context.
func GetLoggerOrDefault ¶
func GetLoggerOrDefault(r *http.Request, l logrus.FieldLogger) logrus.FieldLogger
GetLoggerOrDefault returns the logger from the request context, or the given default one if it is not found.
Types ¶
type BaseURL ¶
type BaseURL struct {
// contains filtered or unexported fields
}
BaseURL represents the server's base url.
func ParseBaseURL ¶
ParseBaseURL creates a new BaseURL by parsing the string form.
type Route ¶
Route represents a set of method, path and http.Handler.
func PrefixRoutes ¶
PrefixRoutes adds prefixes to the routes.
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
Router represents an abstract http router.
type Server ¶
type Server struct { HTTPS struct { LetsEncrypt struct { Directory string WhiteList []string } Certificate struct { Certfile string Keyfile string } } // contains filtered or unexported fields }
Server is the main application server.
func New ¶
func New(logger logrus.FieldLogger, addr string, panicFormatter negroni.PanicFormatter) *Server
New creates a new server.
func (*Server) CreateHTTPServer ¶
CreateHTTPServer creates a http.Server from the application server.
This server is fully configured and it is ready to be started.
Click to show internal directories.
Click to hide internal directories.