Documentation ¶
Rendered for js/wasm
Index ¶
- Variables
- type HashRouter
- func (r *HashRouter) AfterPageChange(f func(vars.Vars, *url.URL))
- func (r *HashRouter) Error(code int, msg string) rterr.RouterError
- func (r *HashRouter) Handle(hash string)
- func (r *HashRouter) Match(hash string) (*routes.Route, bool)
- func (r *HashRouter) NameToTitle(val bool)
- func (r *HashRouter) OnError(cb func(err error))
- func (r *HashRouter) OnLoad(f func())
- func (r *HashRouter) OnPageChange(f func(vars.Vars, *url.URL))
- func (r *HashRouter) Redirect(hash string)
- func (r *HashRouter) Register(name, hash string, callable func(v vars.Vars, u *url.URL)) *routes.Route
- func (r *HashRouter) Run()
- func (r *HashRouter) SkipTrailingSlash()
- func (r *HashRouter) Throw(code int)
- func (r *HashRouter) Use(middleware func(vars.Vars, *url.URL, *routes.Route, rterr.ErrorThrower) bool)
Constants ¶
This section is empty.
Variables ¶
View Source
var RT_PREFIX = "router:"
View Source
var RT_PREFIX_EXTERNAL = "external:"
Functions ¶
This section is empty.
Types ¶
type HashRouter ¶
type HashRouter struct {
// contains filtered or unexported fields
}
func (*HashRouter) AfterPageChange ¶
func (r *HashRouter) AfterPageChange(f func(vars.Vars, *url.URL))
Set after page change function.
func (*HashRouter) Error ¶
func (r *HashRouter) Error(code int, msg string) rterr.RouterError
Throw an error in the router with a message.
func (*HashRouter) Handle ¶
func (r *HashRouter) Handle(hash string)
func (*HashRouter) NameToTitle ¶
func (r *HashRouter) NameToTitle(val bool)
func (*HashRouter) OnError ¶
func (r *HashRouter) OnError(cb func(err error))
Decide what to do on errors.
func (*HashRouter) OnPageChange ¶
func (r *HashRouter) OnPageChange(f func(vars.Vars, *url.URL))
Set on page change function.
func (*HashRouter) Redirect ¶
func (r *HashRouter) Redirect(hash string)
func (*HashRouter) Register ¶
func (r *HashRouter) Register(name, hash string, callable func(v vars.Vars, u *url.URL)) *routes.Route
Add a route to the router.
func (*HashRouter) SkipTrailingSlash ¶
func (r *HashRouter) SkipTrailingSlash()
Skiptrailingslash to adhere to the router interface
func (*HashRouter) Throw ¶
func (r *HashRouter) Throw(code int)
Throw an error in the router with predefined error code messages.
Click to show internal directories.
Click to hide internal directories.