Documentation ¶
Index ¶
- type FrontRouter
- func (fr *FrontRouter) Add(prefix string, handler routerHandler)
- func (fr *FrontRouter) ServeHTTP(w http.ResponseWriter, req *http.Request)
- func (fr *FrontRouter) SetFallbackHandlers(handlers []OptionalHandler)
- func (fr *FrontRouter) SetFinalFallbackHandler(handler http.Handler)
- func (fr *FrontRouter) SetPrimaryHandlers(handlers []OptionalHandler)
- type Module
- type OptionalHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FrontRouter ¶
type FrontRouter struct {
// contains filtered or unexported fields
}
FrontRouter is a http.handler which serves multiple sites based on the host/path prefix
func (*FrontRouter) Add ¶
func (fr *FrontRouter) Add(prefix string, handler routerHandler)
Add appends new Handler to Frontrouter
func (*FrontRouter) ServeHTTP ¶
func (fr *FrontRouter) ServeHTTP(w http.ResponseWriter, req *http.Request)
ServeHTTP gets Router for Request and lets it handle it
func (*FrontRouter) SetFallbackHandlers ¶
func (fr *FrontRouter) SetFallbackHandlers(handlers []OptionalHandler)
SetFallbackHandlers sets list of optional fallback Handlers
func (*FrontRouter) SetFinalFallbackHandler ¶
func (fr *FrontRouter) SetFinalFallbackHandler(handler http.Handler)
SetFinalFallbackHandler sets Fallback for undefined Handler
func (*FrontRouter) SetPrimaryHandlers ¶
func (fr *FrontRouter) SetPrimaryHandlers(handlers []OptionalHandler)
SetPrimaryHandlers sets list of optional fallback Handlers
type Module ¶
type Module struct {
// contains filtered or unexported fields
}
Module for core/prefix_router
type OptionalHandler ¶
type OptionalHandler interface {
TryServeHTTP(rw http.ResponseWriter, req *http.Request) (proceed bool, err error)
}
OptionalHandler tries to handle a request
Click to show internal directories.
Click to hide internal directories.