22 lines
341 B
Go
22 lines
341 B
Go
package tg
|
|
|
|
func Go(pth Path) UI {
|
|
return UI{
|
|
GoWidget(pth),
|
|
}
|
|
}
|
|
|
|
type GoWidget string
|
|
// Implementing the Server interface.
|
|
func (widget GoWidget) Serve(c Context) {
|
|
c.input.Close()
|
|
c.Go(Path(widget))
|
|
}
|
|
|
|
func (widget GoWidget) Render(c Context) UI {
|
|
return UI{widget}
|
|
}
|
|
|
|
func (widget GoWidget) Filter(u Update) bool {
|
|
return true
|
|
}
|