Documentation ¶
Index ¶
- Variables
- func DefaultFuncMap() template.FuncMap
- func UserError(err error) string
- type Context
- type Controller
- type DOM
- type DefaultErrorView
- func (d DefaultErrorView) Content() string
- func (d DefaultErrorView) EventReceiver() <-chan Event
- func (d DefaultErrorView) Extensions() []string
- func (d DefaultErrorView) FuncMap() template.FuncMap
- func (d DefaultErrorView) Layout() string
- func (d DefaultErrorView) LayoutContentName() string
- func (d DefaultErrorView) OnEvent(ctx Context) error
- func (d DefaultErrorView) OnMount(ctx Context) (Status, M)
- func (d DefaultErrorView) Partials() []string
- type DefaultView
- func (d DefaultView) Content() string
- func (d DefaultView) EventReceiver() <-chan Event
- func (d DefaultView) Extensions() []string
- func (d DefaultView) FuncMap() template.FuncMap
- func (d DefaultView) Layout() string
- func (d DefaultView) LayoutContentName() string
- func (d DefaultView) OnEvent(ctx Context) error
- func (d DefaultView) OnMount(ctx Context) (Status, M)
- func (d DefaultView) Partials() []string
- type Event
- type EventHandler
- type M
- type Op
- type Operation
- type Option
- func DevelopmentMode(enable bool) Option
- func DisableTemplateCache() Option
- func EnableDebugLog() Option
- func EnableHTMLFormatting() Option
- func EnableWatch(paths ...string) Option
- func WithErrorView(view View) Option
- func WithSubscribeTopic(f func(r *http.Request) *string) Option
- func WithUpgrader(upgrader websocket.Upgrader) Option
- type Status
- type Store
- type View
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultUserErrorMessage = "internal error"
Functions ¶
func DefaultFuncMap ¶
Types ¶
type Controller ¶
type Controller interface {
Handler(view View) http.HandlerFunc
}
func Websocket ¶
func Websocket(name string, options ...Option) Controller
type DOM ¶
type DOM interface { SetDataset(selector string, data M) SetAttributes(selector string, data M) RemoveAttributes(selector string, data []string) ToggleClassList(selector string, classList map[string]bool) AddClass(selector, class string) RemoveClass(selector, class string) Morph(selector, template string, data M) Reload() }
type DefaultErrorView ¶ added in v0.0.4
type DefaultErrorView struct{}
func (DefaultErrorView) Content ¶ added in v0.0.4
func (d DefaultErrorView) Content() string
func (DefaultErrorView) EventReceiver ¶ added in v0.0.6
func (d DefaultErrorView) EventReceiver() <-chan Event
func (DefaultErrorView) Extensions ¶ added in v0.0.4
func (d DefaultErrorView) Extensions() []string
func (DefaultErrorView) FuncMap ¶ added in v0.0.4
func (d DefaultErrorView) FuncMap() template.FuncMap
func (DefaultErrorView) Layout ¶ added in v0.0.4
func (d DefaultErrorView) Layout() string
func (DefaultErrorView) LayoutContentName ¶ added in v0.0.4
func (d DefaultErrorView) LayoutContentName() string
func (DefaultErrorView) OnEvent ¶ added in v0.0.4
func (d DefaultErrorView) OnEvent(ctx Context) error
func (DefaultErrorView) OnMount ¶ added in v0.0.4
func (d DefaultErrorView) OnMount(ctx Context) (Status, M)
func (DefaultErrorView) Partials ¶ added in v0.0.4
func (d DefaultErrorView) Partials() []string
type DefaultView ¶ added in v0.0.3
type DefaultView struct{}
func (DefaultView) Content ¶ added in v0.0.3
func (d DefaultView) Content() string
func (DefaultView) EventReceiver ¶ added in v0.0.6
func (d DefaultView) EventReceiver() <-chan Event
func (DefaultView) Extensions ¶ added in v0.0.3
func (d DefaultView) Extensions() []string
func (DefaultView) FuncMap ¶ added in v0.0.3
func (d DefaultView) FuncMap() template.FuncMap
func (DefaultView) Layout ¶ added in v0.0.3
func (d DefaultView) Layout() string
func (DefaultView) LayoutContentName ¶ added in v0.0.3
func (d DefaultView) LayoutContentName() string
func (DefaultView) OnEvent ¶ added in v0.0.3
func (d DefaultView) OnEvent(ctx Context) error
func (DefaultView) Partials ¶ added in v0.0.3
func (d DefaultView) Partials() []string
type Event ¶
type Event struct { ID string `json:"id"` Selector string `json:"selector"` Template string `json:"template"` Params json.RawMessage `json:"params"` }
func (Event) DecodeParams ¶
type EventHandler ¶
type Operation ¶
type Option ¶
type Option func(*controlOpt)
func DevelopmentMode ¶ added in v0.0.4
func DisableTemplateCache ¶
func DisableTemplateCache() Option
func EnableDebugLog ¶
func EnableDebugLog() Option
func EnableHTMLFormatting ¶
func EnableHTMLFormatting() Option
func EnableWatch ¶
func WithErrorView ¶ added in v0.0.4
func WithUpgrader ¶
type View ¶ added in v0.0.3
type View interface { // Content represents the path to the html page content Content() string // Layout represents the path to the base layout to be used. /* layout.html e.g. <!DOCTYPE html> <html lang="en"> <head> <title>{{.app_name}}</title> {{template "header" .}} </head> <body> {{template "navbar" .}} <div> {{template "content" .}} </div> {{template "footer" .}} </body> </html> The {{template "content" .}} directive is replaced by the page in the path exposed by `Content` */ Layout() string LayoutContentName() string Partials() []string Extensions() []string FuncMap() template.FuncMap OnMount(ctx Context) (Status, M) OnEvent(ctx Context) error EventReceiver() <-chan Event }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.