router

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 9, 2021 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Request

type Request struct {
	R *http.Request
}

func (*Request) Context

func (req *Request) Context() context.Context

func (*Request) Cookie

func (req *Request) Cookie(name string) string

func (*Request) File

func (req *Request) File(name string) io.Reader

func (*Request) Header

func (req *Request) Header(name string) string

func (*Request) Host

func (req *Request) Host() string

func (*Request) Method

func (req *Request) Method() string

func (*Request) Path

func (req *Request) Path() string

func (*Request) Post

func (req *Request) Post(name string) string

func (*Request) Query

func (req *Request) Query(name string) string

func (*Request) QueryInt

func (req *Request) QueryInt(name string) int

func (*Request) RouteName

func (req *Request) RouteName() string

func (*Request) URL

func (req *Request) URL() *url.URL

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) Cookie

func (res *Response) Cookie(cookie *http.Cookie) interfaces.Response

func (*Response) Data

func (res *Response) Data(data interface{}) interfaces.Result

func (*Response) End

func (res *Response) End() interfaces.Result

func (*Response) Error

func (res *Response) Error(err error) interfaces.Result

func (*Response) Header

func (res *Response) Header(name, value string) interfaces.Response

func (*Response) Redirect

func (res *Response) Redirect(uri string, code int) interfaces.Result

func (*Response) RedirectRoute

func (res *Response) RedirectRoute(name string, params map[string]string, code int) interfaces.Result

func (*Response) Sprintf

func (res *Response) Sprintf(format string, a ...interface{}) interfaces.Result

func (*Response) Status

func (res *Response) Status(status int) interfaces.Response

func (*Response) View

func (res *Response) View(name, layout string, data map[string]interface{}) interfaces.Result

type Result

type Result struct {
	// contains filtered or unexported fields
}

func (*Result) Data

func (r *Result) Data(data interface{}) interfaces.Result

func (*Result) Error

func (r *Result) Error(err error) interfaces.Result

func (*Result) Redirect

func (r *Result) Redirect(uri string, code int) interfaces.Result

func (*Result) RedirectRoute

func (r *Result) RedirectRoute(name string, params map[string]string, code int) interfaces.Result

func (*Result) Sprintf

func (r *Result) Sprintf(format string, a ...interface{}) interfaces.Result

func (*Result) View

func (r *Result) View(name, layout string, data map[string]interface{}) interfaces.Result

type Route

type Route struct {
	// contains filtered or unexported fields
}

func NewRoute

func NewRoute(router *Router, route *mux.Route) *Route

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) Host

func (r *Route) Host(uri string) interfaces.Route

func (*Route) Match

func (r *Route) Match(methods []string, uri string, callback interfaces.Callback) interfaces.Route

func (*Route) Methods

func (r *Route) Methods(methods ...string) interfaces.Route

func (*Route) Name

func (r *Route) Name(n string) 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) Prefix

func (r *Route) Prefix(uri string) interfaces.Route

func (*Route) Put

func (r *Route) Put(uri string, callback interfaces.Callback) interfaces.Route

func (*Route) Redirect

func (r *Route) Redirect(uri, to string, code int) 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) UseG

func (r *Route) UseG(m ...func(http.Handler) http.Handler)

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

func (*Route) WithG

func (r *Route) WithG(m ...func(http.Handler) http.Handler) interfaces.Route

type Router

type Router struct {
	// contains filtered or unexported fields
}

func NewRouter

func NewRouter(app *hemlock.Application) *Router

func NewRouterWithMux

func NewRouterWithMux(app *hemlock.Application, m *mux.Router, isRoot bool) *Router

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) Handler

func (router *Router) Handler() http.Handler

Handler returns the HTTP handler

func (*Router) Head

func (router *Router) Head(uri string, callback interfaces.Callback) interfaces.Route

func (*Router) Host

func (router *Router) Host(hostname string) interfaces.Route

func (*Router) Match

func (router *Router) Match(methods []string, uri string, callback interfaces.Callback) interfaces.Route

func (*Router) Methods

func (router *Router) Methods(methods ...string) 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) Prefix

func (router *Router) Prefix(uri string) interfaces.Route

func (*Router) Put

func (router *Router) Put(uri string, callback interfaces.Callback) interfaces.Route

func (*Router) Redirect

func (router *Router) Redirect(uri, to string, code int) 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) URL

func (router *Router) URL(p string) string

func (*Router) Use

func (router *Router) Use(m ...interfaces.Middleware)

func (*Router) UseG

func (router *Router) UseG(m ...func(http.Handler) http.Handler)

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

func (*Router) WithG

func (router *Router) WithG(m ...func(http.Handler) http.Handler) interfaces.Route

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL