Documentation ¶
Index ¶
- func IsLocalhost(remoteAddr string) bool
- func SplitAddrPort(host string) string
- func SplitDomainSubdomain(host string) (domain string, subdomain string)
- type Context
- func (ctx *Context) DomainMux() *DomainMux
- func (ctx *Context) HasParam(key string) bool
- func (ctx *Context) HasValue(key string) bool
- func (ctx *Context) Host() string
- func (ctx *Context) IsServeCalled() bool
- func (ctx *Context) Next(w http.ResponseWriter, r *http.Request)
- func (ctx *Context) Param(key string) string
- func (ctx *Context) Path() []string
- func (ctx *Context) Redirect(host string, rerun bool)
- func (ctx *Context) SetServeCalled()
- func (ctx *Context) SetValue(key, value string)
- func (ctx *Context) Value(key string) string
- type DomainMux
- func (dm *DomainMux) Middleware(pattern string, middlewares ...Handler)
- func (dm *DomainMux) RedirectIfLocal(isLocal func(remoteAddr string) bool, rerun bool, middleware HandlerFunc) Handler
- func (dm *DomainMux) Serve(pattern string, handler Handler)
- func (dm *DomainMux) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (dm *DomainMux) String() string
- type Handler
- type HandlerFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsLocalhost ¶
func SplitAddrPort ¶
func SplitDomainSubdomain ¶
Types ¶
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
func (*Context) IsServeCalled ¶
func (*Context) SetServeCalled ¶
func (ctx *Context) SetServeCalled()
type DomainMux ¶
type DomainMux struct {
// contains filtered or unexported fields
}
func NewDomainMux ¶
func NewDomainMux() *DomainMux
func (*DomainMux) Middleware ¶
func (*DomainMux) RedirectIfLocal ¶
type Handler ¶
type Handler interface {
ServeDomainMux(ctx *Context, w http.ResponseWriter, r *http.Request)
}
func StandardHandler ¶
type HandlerFunc ¶
type HandlerFunc func(ctx *Context, w http.ResponseWriter, r *http.Request)
func StandardHandlerFunc ¶
func StandardHandlerFunc(f http.HandlerFunc) HandlerFunc
func (HandlerFunc) ServeDomainMux ¶
func (f HandlerFunc) ServeDomainMux(ctx *Context, w http.ResponseWriter, r *http.Request)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.