Documentation ¶
Index ¶
- Constants
- func ByKind(ks ...Kind) func(*Route) bool
- func ByPath(pcs ...string) func(*Route) bool
- func DumpRequest(next http.Handler) http.Handler
- func GZIP(h http.Handler) http.Handler
- func LogRequests(h http.Handler) http.Handler
- func LongPolling() (middleware Decorator, signal SignalFunc)
- func NoCache(h http.Handler) http.Handler
- func SetAllCORSHeaders(w http.ResponseWriter, r *http.Request, ac AccessControl)
- func Tree(n *Route) string
- type AccessControl
- type Chain
- type Decorator
- type Kind
- type Manager
- type Route
- func (r *Route) Append(child *Route) error
- func (r *Route) Children() Routes
- func (r *Route) DELETE(h http.Handler)
- func (r *Route) FirstChild() *Route
- func (r *Route) FullPath() string
- func (r *Route) GET(h http.Handler)
- func (r *Route) HEAD(h http.Handler)
- func (r *Route) Handler(m string) (http.Handler, bool)
- func (r *Route) IsFirstChild() bool
- func (r *Route) IsLastChild() bool
- func (r *Route) IsLeaf() bool
- func (r *Route) IsRoot() bool
- func (r *Route) Kind() Kind
- func (r *Route) LastChild() *Route
- func (r *Route) Level() int
- func (r *Route) Match(path string) (*Route, map[string]string)
- func (r *Route) Methods() []string
- func (r *Route) OPTIONS(h http.Handler)
- func (r *Route) PATCH(h http.Handler)
- func (r *Route) POST(h http.Handler)
- func (r *Route) PUT(h http.Handler)
- func (r *Route) Parent() *Route
- func (r *Route) Path() string
- func (r *Route) Route(path string) *Route
- func (r *Route) Set(nr *Route) error
- func (r *Route) SetHandler(m string, h http.Handler)
- func (r *Route) Siblings() Routes
- func (r *Route) String() string
- type Router
- type Routes
- type Signal
- type SignalFunc
- type Timing
Constants ¶
View Source
const ( HeaderOrigin = "Origin" HeaderAccessControlAllowOrigin = "Access-Control-Allow-Origin" HeaderAccessControlExposeHeaders = "Access-Control-Expose-Headers" HeaderAccessControlMaxAge = "Access-Control-Max-Age" HeaderAccessControlAllowCredentials = "Access-Control-Allow-Credentials" HeaderAccessControlAllowMethods = "Access-Control-Allow-Methods" HeaderAccessControlAllowHeaders = "Access-Control-Allow-Headers" )
View Source
const ( HeaderAccessControlRequestMethod = "Access-Control-Request-Method" HeaderAccessControlRequestHeaders = "Access-Control-Request-Headers" )
View Source
const ( HeaderAcceptEncoding = "Accept-Encoding" HeaderContentType = "Content-Type" HeaderContentEncoding = "Content-Encoding" HeaderVary = "Vary" )
View Source
const ( HeaderEtag = "Etag" HeaderLongPoll = "Long-Poll" HeaderIfNoneMatch = "If-None-Match" )
View Source
const (
ContentEncodingGZIP = "gzip"
)
Variables ¶
This section is empty.
Functions ¶
func LongPolling ¶
func LongPolling() (middleware Decorator, signal SignalFunc)
func SetAllCORSHeaders ¶
func SetAllCORSHeaders(w http.ResponseWriter, r *http.Request, ac AccessControl)
Types ¶
type AccessControl ¶
type AccessControl struct { AllowOrigin string ExposeHeaders []string MaxAge uint64 AllowCredentials bool AllowMethods []string AllowHeaders []string }
var ( AccessControlDefaults AccessControl AccessControlPreflight AccessControl )
type Route ¶
type Route struct {
// contains filtered or unexported fields
}
func (*Route) FirstChild ¶
func (*Route) IsFirstChild ¶
func (*Route) IsLastChild ¶
type SignalFunc ¶
type SignalFunc func(key string)
Click to show internal directories.
Click to hide internal directories.