Documentation ¶
Index ¶
- Variables
- func DefaultFuncMap() template.FuncMap
- func UserError(err error) string
- type Context
- type Controller
- type DOM
- type Event
- type EventHandler
- type M
- type OnMount
- type Op
- type Operation
- type Option
- func DisableTemplateCache() Option
- func EnableDebugLog() Option
- func EnableHTMLFormatting() Option
- func EnableWatch(paths ...string) Option
- func WithRequestContext(f func(r *http.Request) context.Context) Option
- func WithSubscribeTopic(f func(r *http.Request) *string) Option
- func WithUpgrader(upgrader websocket.Upgrader) Option
- type Session
- type SessionStore
- type ViewHandler
- type ViewOption
- func WithErrorPage(errorPage string) ViewOption
- func WithEventHandlers(eventHandlers map[string]EventHandler) ViewOption
- func WithExtensions(extensions ...string) ViewOption
- func WithFuncMap(funcMap template.FuncMap) ViewOption
- func WithLayout(layout string) ViewOption
- func WithLayoutContentName(layoutContentName string) ViewOption
- func WithOnMount(onMountFunc OnMount) ViewOption
- func WithPartials(partials ...string) ViewOption
- func WithViewHandler(viewHandler ViewHandler) ViewOption
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultUserErrorMessage = "internal error"
Functions ¶
func DefaultFuncMap ¶
Types ¶
type Controller ¶
type Controller interface {
NewView(page string, options ...ViewOption) http.HandlerFunc
}
func Websocket ¶
func Websocket(name *string, options ...Option) Controller
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 DisableTemplateCache ¶
func DisableTemplateCache() Option
func EnableDebugLog ¶
func EnableDebugLog() Option
func EnableHTMLFormatting ¶
func EnableHTMLFormatting() Option
func EnableWatch ¶
func WithUpgrader ¶
type Session ¶
type Session interface { DOM() DOM Store() SessionStore Temporary(keys ...string) }
type SessionStore ¶
type ViewHandler ¶
type ViewOption ¶
type ViewOption func(opt *viewOpt)
func WithErrorPage ¶
func WithErrorPage(errorPage string) ViewOption
func WithEventHandlers ¶
func WithEventHandlers(eventHandlers map[string]EventHandler) ViewOption
func WithExtensions ¶
func WithExtensions(extensions ...string) ViewOption
func WithFuncMap ¶
func WithFuncMap(funcMap template.FuncMap) ViewOption
func WithLayout ¶
func WithLayout(layout string) ViewOption
func WithLayoutContentName ¶
func WithLayoutContentName(layoutContentName string) ViewOption
func WithOnMount ¶
func WithOnMount(onMountFunc OnMount) ViewOption
func WithPartials ¶
func WithPartials(partials ...string) ViewOption
func WithViewHandler ¶
func WithViewHandler(viewHandler ViewHandler) ViewOption
Click to show internal directories.
Click to hide internal directories.