Documentation ¶
Index ¶
- type Request
- func (req *Request) Context() context.Context
- func (req *Request) Cookie(name string) string
- func (req *Request) File(name string) io.Reader
- func (req *Request) Header(name string) string
- func (req *Request) Host() string
- func (req *Request) Method() string
- func (req *Request) Path() string
- func (req *Request) Post(name string) string
- func (req *Request) Query(name string) string
- func (req *Request) QueryInt(name string) int
- func (req *Request) RouteName() string
- func (req *Request) URL() *url.URL
- func (req *Request) WithContext(ctx context.Context) interfaces.Request
- type Response
- func (res *Response) Cookie(cookie *http.Cookie) interfaces.Response
- func (res *Response) Data(data interface{}) interfaces.Result
- func (res *Response) End() interfaces.Result
- func (res *Response) Error(err error) interfaces.Result
- func (res *Response) Header(name, value string) interfaces.Response
- func (res *Response) Redirect(uri string, code int) interfaces.Result
- func (res *Response) RedirectRoute(name string, params map[string]string, code int) interfaces.Result
- func (res *Response) Sprintf(format string, a ...interface{}) interfaces.Result
- func (res *Response) Status(status int) interfaces.Response
- func (res *Response) View(name, layout string, data map[string]interface{}) interfaces.Result
- type Result
- func (r *Result) Data(data interface{}) interfaces.Result
- func (r *Result) Error(err error) interfaces.Result
- func (r *Result) Redirect(uri string, code int) interfaces.Result
- func (r *Result) RedirectRoute(name string, params map[string]string, code int) interfaces.Result
- func (r *Result) Sprintf(format string, a ...interface{}) interfaces.Result
- func (r *Result) View(name, layout string, data map[string]interface{}) interfaces.Result
- type Route
- func (r *Route) Any(uri string, callback interfaces.Callback) interfaces.Route
- func (r *Route) Callback(callback interfaces.Callback) interfaces.Route
- func (r *Route) Connect(uri string, callback interfaces.Callback) interfaces.Route
- func (r *Route) Delete(uri string, callback interfaces.Callback) interfaces.Route
- func (r *Route) Get(uri string, callback interfaces.Callback) interfaces.Route
- func (r *Route) Group(fn func(router interfaces.Router))
- func (r *Route) Head(uri string, callback interfaces.Callback) interfaces.Route
- func (r *Route) Host(uri string) interfaces.Route
- func (r *Route) Match(methods []string, uri string, callback interfaces.Callback) interfaces.Route
- func (r *Route) Methods(methods ...string) interfaces.Route
- func (r *Route) Name(n string) interfaces.Route
- func (r *Route) Options(uri string, callback interfaces.Callback) interfaces.Route
- func (r *Route) Patch(uri string, callback interfaces.Callback) interfaces.Route
- func (r *Route) Post(uri string, callback interfaces.Callback) interfaces.Route
- func (r *Route) Prefix(uri string) interfaces.Route
- func (r *Route) Put(uri string, callback interfaces.Callback) interfaces.Route
- func (r *Route) Redirect(uri, to string, code int) interfaces.Route
- func (r *Route) Trace(uri string, callback interfaces.Callback) interfaces.Route
- func (r *Route) Use(m ...interfaces.Middleware)
- func (r *Route) UseG(m ...func(http.Handler) http.Handler)
- func (r *Route) View(uri, view, layout string, data map[string]interface{}) interfaces.Route
- func (r *Route) With(m ...interfaces.Middleware) interfaces.Route
- func (r *Route) WithG(m ...func(http.Handler) http.Handler) interfaces.Route
- type Router
- func (router *Router) Any(uri string, callback interfaces.Callback) interfaces.Route
- func (router *Router) Callback(callback interfaces.Callback) interfaces.Route
- func (router *Router) Connect(uri string, callback interfaces.Callback) interfaces.Route
- func (router *Router) Delete(uri string, callback interfaces.Callback) interfaces.Route
- func (router *Router) Get(uri string, callback interfaces.Callback) interfaces.Route
- func (router *Router) Handler() http.Handler
- func (router *Router) Head(uri string, callback interfaces.Callback) interfaces.Route
- func (router *Router) Host(hostname string) interfaces.Route
- func (router *Router) Match(methods []string, uri string, callback interfaces.Callback) interfaces.Route
- func (router *Router) Methods(methods ...string) interfaces.Route
- func (router *Router) Options(uri string, callback interfaces.Callback) interfaces.Route
- func (router *Router) Patch(uri string, callback interfaces.Callback) interfaces.Route
- func (router *Router) Post(uri string, callback interfaces.Callback) interfaces.Route
- func (router *Router) Prefix(uri string) interfaces.Route
- func (router *Router) Put(uri string, callback interfaces.Callback) interfaces.Route
- func (router *Router) Redirect(uri, to string, code int) interfaces.Route
- func (router *Router) Route(name string, params interfaces.RouteParams) string
- func (router *Router) Trace(uri string, callback interfaces.Callback) interfaces.Route
- func (router *Router) URL(p string) string
- func (router *Router) Use(m ...interfaces.Middleware)
- func (router *Router) UseG(m ...func(http.Handler) http.Handler)
- func (router *Router) View(uri, view, layout string, data map[string]interface{}) interfaces.Route
- func (router *Router) With(m ...interfaces.Middleware) interfaces.Route
- func (router *Router) WithG(m ...func(http.Handler) http.Handler) interfaces.Route
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Request ¶
func (*Request) WithContext ¶
func (req *Request) WithContext(ctx context.Context) interfaces.Request
type Response ¶
type Response struct { W http.ResponseWriter // contains filtered or unexported fields }
func (*Response) Data ¶
func (res *Response) Data(data interface{}) interfaces.Result
func (*Response) End ¶
func (res *Response) End() interfaces.Result
func (*Response) RedirectRoute ¶
type Result ¶
type Result struct {
// contains filtered or unexported fields
}
func (*Result) Data ¶
func (r *Result) Data(data interface{}) interfaces.Result
func (*Result) RedirectRoute ¶
type Route ¶
type Route struct {
// contains filtered or unexported fields
}
func (*Route) Any ¶
func (r *Route) Any(uri string, callback interfaces.Callback) interfaces.Route
func (*Route) Callback ¶
func (r *Route) Callback(callback interfaces.Callback) interfaces.Route
func (*Route) Connect ¶
func (r *Route) Connect(uri string, callback interfaces.Callback) interfaces.Route
func (*Route) Delete ¶
func (r *Route) Delete(uri string, callback interfaces.Callback) interfaces.Route
func (*Route) Get ¶
func (r *Route) Get(uri string, callback interfaces.Callback) interfaces.Route
func (*Route) Group ¶
func (r *Route) Group(fn func(router interfaces.Router))
func (*Route) Head ¶
func (r *Route) Head(uri string, callback interfaces.Callback) interfaces.Route
func (*Route) Match ¶
func (r *Route) Match(methods []string, uri string, callback interfaces.Callback) interfaces.Route
func (*Route) Options ¶
func (r *Route) Options(uri string, callback interfaces.Callback) interfaces.Route
func (*Route) Patch ¶
func (r *Route) Patch(uri string, callback interfaces.Callback) interfaces.Route
func (*Route) Post ¶
func (r *Route) Post(uri string, callback interfaces.Callback) interfaces.Route
func (*Route) Put ¶
func (r *Route) Put(uri string, callback interfaces.Callback) interfaces.Route
func (*Route) Trace ¶
func (r *Route) Trace(uri string, callback interfaces.Callback) interfaces.Route
func (*Route) Use ¶
func (r *Route) Use(m ...interfaces.Middleware)
func (*Route) View ¶
func (r *Route) View(uri, view, layout string, data map[string]interface{}) interfaces.Route
func (*Route) With ¶
func (r *Route) With(m ...interfaces.Middleware) interfaces.Route
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
func NewRouter ¶
func NewRouter(app *hemlock.Application) *Router
func NewRouterWithMux ¶
func (*Router) Any ¶
func (router *Router) Any(uri string, callback interfaces.Callback) interfaces.Route
func (*Router) Callback ¶
func (router *Router) Callback(callback interfaces.Callback) interfaces.Route
func (*Router) Connect ¶
func (router *Router) Connect(uri string, callback interfaces.Callback) interfaces.Route
func (*Router) Delete ¶
func (router *Router) Delete(uri string, callback interfaces.Callback) interfaces.Route
func (*Router) Get ¶
func (router *Router) Get(uri string, callback interfaces.Callback) interfaces.Route
func (*Router) Head ¶
func (router *Router) Head(uri string, callback interfaces.Callback) interfaces.Route
func (*Router) Match ¶
func (router *Router) Match(methods []string, uri string, callback interfaces.Callback) interfaces.Route
func (*Router) Options ¶
func (router *Router) Options(uri string, callback interfaces.Callback) interfaces.Route
func (*Router) Patch ¶
func (router *Router) Patch(uri string, callback interfaces.Callback) interfaces.Route
func (*Router) Post ¶
func (router *Router) Post(uri string, callback interfaces.Callback) interfaces.Route
func (*Router) Put ¶
func (router *Router) Put(uri string, callback interfaces.Callback) interfaces.Route
func (*Router) Route ¶
func (router *Router) Route(name string, params interfaces.RouteParams) string
func (*Router) Trace ¶
func (router *Router) Trace(uri string, callback interfaces.Callback) interfaces.Route
func (*Router) Use ¶
func (router *Router) Use(m ...interfaces.Middleware)
func (*Router) View ¶
func (router *Router) View(uri, view, layout string, data map[string]interface{}) interfaces.Route
func (*Router) With ¶
func (router *Router) With(m ...interfaces.Middleware) interfaces.Route
Click to show internal directories.
Click to hide internal directories.