Documentation
¶
Index ¶
- func Mount(parentID string) error
- func Navigate(parentID string, hash string) error
- func RegisterHandlers(handlers ...any) error
- func Render() error
- func SetCacheSize(size int)
- func SetDefaultRoute(route string)
- func SetDevMode(enabled bool)
- func SetOutputDir(dir string)
- func Start(parentID string) error
- func TestGetModules() []*registeredModule
- func TestIsDevMode() bool
- func TestParseRoute(hash string) (module string, params []string)
- func TestResetHandler()
- func TestResetWasm()
- type Config
- type Module
- type ModuleLifecycle
- type Parameterized
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterHandlers ¶
RegisterHandlers registers all handlers with site and crudp
func Render ¶ added in v0.0.17
func Render() error
Render registers the site handlers with the provided mux and prepares assets. DEPRECATED: Use Mount(parentID) instead.
func SetCacheSize ¶ added in v0.0.17
func SetCacheSize(size int)
SetCacheSize configures module cache size (default: 3)
func SetDefaultRoute ¶ added in v0.0.17
func SetDefaultRoute(route string)
SetDefaultRoute configures default route (default: "home")
func SetDevMode ¶ added in v0.0.17
func SetDevMode(enabled bool)
SetDevMode configures development mode (default: false)
func SetOutputDir ¶ added in v0.0.17
func SetOutputDir(dir string)
SetOutputDir configures the output directory for assets (default: "./public")
func TestGetModules ¶ added in v0.0.46
func TestGetModules() []*registeredModule
TestGetModules returns the list of registered modules. For testing purposes only.
func TestIsDevMode ¶ added in v0.0.46
func TestIsDevMode() bool
TestIsDevMode returns the current DevMode state of the handler. For testing purposes only.
func TestParseRoute ¶ added in v0.0.46
TestParseRoute exposes the internal parseRoute function for testing. For testing purposes only.
func TestResetHandler ¶ added in v0.0.46
func TestResetHandler()
TestResetHandler resets the global handler state for testing. For testing purposes only.
func TestResetWasm ¶ added in v0.0.46
func TestResetWasm()
TestResetWasm resets the active module and cache for testing. For testing purposes only.
Types ¶
type Config ¶ added in v0.0.17
func TestGetConfig ¶ added in v0.0.46
func TestGetConfig() *Config
TestGetConfig returns the global configuration. For testing purposes only.
type Module ¶ added in v0.0.17
Module represents a top-level site module. It combines a DOM component with site-specific identifiers.
type ModuleLifecycle ¶ added in v0.0.17
type ModuleLifecycle interface {
}
ModuleLifecycle provides hooks for navigation events
type Parameterized ¶ added in v0.0.17
type Parameterized interface {
SetParams(params []string)
}
Parameterized modules can receive route parameters