Documentation ¶
Overview ¶
+build js
Index ¶
- func ClientSide() bool
- func DevMode() bool
- func FindContainer(query string) dom.Node
- func If(cond bool, v string) string
- func InitApp(basepath string, router driver.Router, container dom.Node)
- func MergeMaps(m1, m2 map[string]interface{}) map[string]interface{}
- func NewVNodeList(nodes ...interface{}) []vdom.VNode
- func QueryEscape(str string) string
- func Route(routeName string, params ...interface{}) string
- func SetMode(appMode AppMode)
- func Str(value interface{}) string
- func WrapEvt(handler func(dom.Event)) interface{}
- type AppMode
- type Application
- type Component
- type Context
- type ControllerFunc
- type DefaultRouter
- func (r *DefaultRouter) Build()
- func (r *DefaultRouter) Handle(route string, routeName string, handler ControllerFunc)
- func (r *DefaultRouter) Lookup(path string) (interface{}, map[string]string)
- func (r *DefaultRouter) PathFromRoute(route string, params ...interface{}) string
- func (r *DefaultRouter) Render(url *gourl.URL)
- func (r *DefaultRouter) RouteByName(routeName string) (route string, ok bool)
- func (r *DefaultRouter) SetErrorHandler(handler func(error))
- func (r *DefaultRouter) SetNotFoundHandler(c ControllerFunc)
- type M
- type RouteParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClientSide ¶
func ClientSide() bool
func FindContainer ¶
func NewVNodeList ¶
func QueryEscape ¶
Types ¶
type Application ¶
func App ¶
func App() Application
func (Application) SetURLPath ¶
func (z Application) SetURLPath(newPath string)
type Context ¶
type Context struct { Params RouteParams URL *gourl.URL // contains filtered or unexported fields }
Context provides access to page data and page operations inside a controller function
func (*Context) GoToRemoteURL ¶
type ControllerFunc ¶
type DefaultRouter ¶
type DefaultRouter struct {
// contains filtered or unexported fields
}
func NewRouter ¶
func NewRouter() *DefaultRouter
func (*DefaultRouter) Build ¶
func (r *DefaultRouter) Build()
func (*DefaultRouter) Handle ¶
func (r *DefaultRouter) Handle(route string, routeName string, handler ControllerFunc)
Handle registers a handler for the given route, routeName is a unique name that you assign to a route, to be used in links for example
func (*DefaultRouter) Lookup ¶
func (r *DefaultRouter) Lookup(path string) (interface{}, map[string]string)
func (*DefaultRouter) PathFromRoute ¶
func (r *DefaultRouter) PathFromRoute(route string, params ...interface{}) string
func (*DefaultRouter) Render ¶
func (r *DefaultRouter) Render(url *gourl.URL)
func (*DefaultRouter) RouteByName ¶
func (r *DefaultRouter) RouteByName(routeName string) (route string, ok bool)
func (*DefaultRouter) SetErrorHandler ¶
func (r *DefaultRouter) SetErrorHandler(handler func(error))
func (*DefaultRouter) SetNotFoundHandler ¶
func (r *DefaultRouter) SetNotFoundHandler(c ControllerFunc)
type RouteParams ¶
RouteParams holds the values of named parameters for a route
func (RouteParams) Get ¶
func (rp RouteParams) Get(param string) string
Get returns the string value of the given named parameter
func (RouteParams) ScanTo ¶
func (rp RouteParams) ScanTo(dest interface{}, param string)
ScanTo uses fmt.Sscan to scan the value of the given named parameter to a pointer.
Click to show internal directories.
Click to hide internal directories.