Documentation
¶
Index ¶
- type Context
- type Cookie
- type CookieManager
- type DefaultCookieManager
- type Router
- func (r *Router) CONNECT(path string, handler http.HandlerFunc)
- func (r *Router) DELETE(path string, handler http.HandlerFunc)
- func (r *Router) GET(path string, handler http.HandlerFunc)
- func (r *Router) GetCookie(req *http.Request, name string) (*http.Cookie, error)
- func (r *Router) GetSession(session *Session, key string) string
- func (r *Router) HEAD(path string, handler http.HandlerFunc)
- func (r *Router) HTML(status int, filename string, data interface{}, w http.ResponseWriter)
- func (r *Router) JSON(status int, data interface{}, w http.ResponseWriter)
- func (r *Router) LoadHTMLFiles(filenames ...string)
- func (r *Router) OPTIONS(path string, handler http.HandlerFunc)
- func (r *Router) PATCH(path string, handler http.HandlerFunc)
- func (r *Router) POST(path string, handler http.HandlerFunc)
- func (r *Router) PUT(path string, handler http.HandlerFunc)
- func (r *Router) Redirect(w http.ResponseWriter, req *http.Request, url string)
- func (r *Router) Run(port string)
- func (r *Router) SaveFile(file multipart.File, header *multipart.FileHeader, path string) error
- func (r *Router) ServeHTTP(w http.ResponseWriter, req *http.Request)
- func (r *Router) SetCookie(w http.ResponseWriter, cookie *Cookie)
- func (r *Router) SetSession(session *Session, key, value string)
- func (r *Router) Static(filenames ...string)
- func (r *Router) TRACE(path string, handler http.HandlerFunc)
- type RouterOptions
- type Session
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Context struct { ResponseWriter http.ResponseWriter Request *http.Request // contains filtered or unexported fields }
type CookieManager ¶
type DefaultCookieManager ¶
type DefaultCookieManager struct{}
func (*DefaultCookieManager) SetCookie ¶
func (cm *DefaultCookieManager) SetCookie(w http.ResponseWriter, cookie *Cookie)
type Router ¶
type Router struct { Routes map[string]map[string]http.HandlerFunc CookieManager CookieManager // contains filtered or unexported fields }
func Default ¶
func Default(options ...RouterOptions) *Router
func (*Router) HTML ¶
func (r *Router) HTML(status int, filename string, data interface{}, w http.ResponseWriter)
func (*Router) LoadHTMLFiles ¶
func (*Router) SetSession ¶
type RouterOptions ¶
type RouterOptions struct {
CookieManager CookieManager
}
Click to show internal directories.
Click to hide internal directories.