Documentation ¶
Index ¶
- type Context
- func (c *Context) BindBody(data interface{}) error
- func (c *Context) Error(status int, err error)
- func (c *Context) GetPathValue(key string) string
- func (c *Context) GetQueryParam(key string) string
- func (c *Context) JSON(status int, data interface{})
- func (c *Context) Status(status int)
- func (c *Context) Text(status int, text string)
- type Group
- type HandlerFunc
- type Middleware
- type Request
- type Response
- type Router
- func (s *Router) Delete(path string, handler func(c *Context))
- func (r *Router) Get(path string, handler func(c *Context))
- func (s *Router) Patch(path string, handler func(c *Context))
- func (s *Router) Post(path string, handler func(c *Context))
- func (s *Router) Put(path string, handler func(c *Context))
- func (s *Router) Routes() *http.ServeMux
- func (s *Router) ServeHTTP(w http.ResponseWriter, r *http.Request)
- type SecureCookie
- func (sc *SecureCookie) ClearCookie(w http.ResponseWriter, name string)
- func (sc *SecureCookie) GetEncryptedCookie(req *http.Request, name string) (string, error)
- func (sc *SecureCookie) HasCookie(req *http.Request, name string) bool
- func (sc *SecureCookie) SetEncryptedCookie(w http.ResponseWriter, name, value string, expiry time.Duration) error
- type Server
- func (s *Server) Delete(path string, handler HandlerFunc)
- func (s *Server) Get(path string, handler HandlerFunc)
- func (s *Server) Group(path string, group func(r *Group))
- func (s *Server) Patch(path string, handler HandlerFunc)
- func (s *Server) Post(path string, handler HandlerFunc)
- func (s *Server) Put(path string, handler HandlerFunc)
- func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (s *Server) Start(port string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Context ¶
func NewContext ¶
func NewContext(w http.ResponseWriter, r *http.Request) *Context
func (*Context) GetPathValue ¶
func (*Context) GetQueryParam ¶
type Group ¶ added in v0.0.6
type Group struct {
// contains filtered or unexported fields
}
func (*Group) Delete ¶ added in v0.0.6
func (g *Group) Delete(path string, handler HandlerFunc)
func (*Group) Get ¶ added in v0.0.6
func (g *Group) Get(path string, handler HandlerFunc)
func (*Group) Patch ¶ added in v0.0.6
func (g *Group) Patch(path string, handler HandlerFunc)
func (*Group) Post ¶ added in v0.0.6
func (g *Group) Post(path string, handler HandlerFunc)
func (*Group) Put ¶ added in v0.0.6
func (g *Group) Put(path string, handler HandlerFunc)
type HandlerFunc ¶
type HandlerFunc func(c *Context)
func LoggingMiddleware ¶
func LoggingMiddleware(next HandlerFunc) HandlerFunc
type Middleware ¶
type Middleware func(HandlerFunc) HandlerFunc
type Response ¶
type Response struct {
http.ResponseWriter
}
type SecureCookie ¶
type SecureCookie struct {
// contains filtered or unexported fields
}
func NewSecureCookie ¶
func NewSecureCookie(key string) *SecureCookie
func (*SecureCookie) ClearCookie ¶
func (sc *SecureCookie) ClearCookie(w http.ResponseWriter, name string)
func (*SecureCookie) GetEncryptedCookie ¶
func (*SecureCookie) HasCookie ¶
func (sc *SecureCookie) HasCookie(req *http.Request, name string) bool
func (*SecureCookie) SetEncryptedCookie ¶
func (sc *SecureCookie) SetEncryptedCookie(w http.ResponseWriter, name, value string, expiry time.Duration) error
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) Delete ¶
func (s *Server) Delete(path string, handler HandlerFunc)
func (*Server) Get ¶
func (s *Server) Get(path string, handler HandlerFunc)
func (*Server) Patch ¶ added in v0.0.6
func (s *Server) Patch(path string, handler HandlerFunc)
func (*Server) Post ¶
func (s *Server) Post(path string, handler HandlerFunc)
func (*Server) Put ¶
func (s *Server) Put(path string, handler HandlerFunc)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.