Documentation
¶
Index ¶
- type CachedModule
- type CachedResult
- type JSEnginePool
- func (pool *JSEnginePool) GetEngine() (*SharedJSEngine, error)
- func (pool *JSEnginePool) GetEngineForSession(sessionID string) (*SharedJSEngine, error)
- func (pool *JSEnginePool) ReleaseSessionEngine(sessionID string)
- func (pool *JSEnginePool) ReturnEngine(engine *SharedJSEngine)
- func (pool *JSEnginePool) Stop()
- type JavaScriptHandler
- type Route
- type SharedJSEngine
- type SvelteCompileResult
- type SvelteConfig
- type SvelteHandler
- type TemplateHandler
- type VMManager
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CachedModule ¶ added in v0.3.0
CachedModule represents a cached JavaScript module
type CachedResult ¶ added in v0.4.0
type JSEnginePool ¶ added in v0.3.0
type JSEnginePool struct {
// contains filtered or unexported fields
}
JSEnginePool manages a pool of JavaScript engines
func GetJSEnginePool ¶ added in v0.3.0
func GetJSEnginePool(fs filesystem.FileSystem, version string) *JSEnginePool
GetJSEnginePool returns a JavaScript engine pool for the given filesystem
func (*JSEnginePool) GetEngine ¶ added in v0.3.0
func (pool *JSEnginePool) GetEngine() (*SharedJSEngine, error)
GetEngine gets an available engine from the pool
func (*JSEnginePool) GetEngineForSession ¶ added in v0.3.0
func (pool *JSEnginePool) GetEngineForSession(sessionID string) (*SharedJSEngine, error)
GetEngineForSession gets an engine specifically for a session/client
func (*JSEnginePool) ReleaseSessionEngine ¶ added in v0.3.0
func (pool *JSEnginePool) ReleaseSessionEngine(sessionID string)
ReleaseSessionEngine releases an engine from a session (for cleanup)
func (*JSEnginePool) ReturnEngine ¶ added in v0.3.0
func (pool *JSEnginePool) ReturnEngine(engine *SharedJSEngine)
ReturnEngine returns an engine to the pool
func (*JSEnginePool) Stop ¶ added in v0.3.0
func (pool *JSEnginePool) Stop()
Stop stops all engines in the pool
type JavaScriptHandler ¶
type JavaScriptHandler struct {
// contains filtered or unexported fields
}
func NewJavaScriptHandler ¶
func NewJavaScriptHandler(fs filesystem.FileSystem) *JavaScriptHandler
func NewJavaScriptHandlerWithVersion ¶
func NewJavaScriptHandlerWithVersion(fs filesystem.FileSystem, version string) *JavaScriptHandler
func (*JavaScriptHandler) Handle ¶
func (jh *JavaScriptHandler) Handle(route Route) http.HandlerFunc
type SharedJSEngine ¶ added in v0.3.0
type SharedJSEngine struct {
// contains filtered or unexported fields
}
SharedJSEngine manages a shared JavaScript environment with module caching
func (*SharedJSEngine) ExecuteHTTPMethod ¶ added in v0.3.0
func (engine *SharedJSEngine) ExecuteHTTPMethod(r *http.Request, w http.ResponseWriter, route Route) error
ExecuteHTTPMethod executes an HTTP method handler from a JavaScript module
func (*SharedJSEngine) Start ¶ added in v0.3.0
func (engine *SharedJSEngine) Start() error
Start initializes the shared JavaScript engine
func (*SharedJSEngine) Stop ¶ added in v0.3.0
func (engine *SharedJSEngine) Stop()
Stop shuts down the shared JavaScript engine
type SvelteCompileResult ¶ added in v0.4.0
type SvelteConfig ¶ added in v0.4.0
type SvelteConfig struct {
// Minification settings
MinifyRuntime bool // Enable runtime minification
MinifyComponents bool // Enable component code minification
MinifyCSS bool // Enable CSS minification
DevMode bool // Disable minification in development
// Runtime resource settings
UseExternalRuntime bool // Use external runtime file instead of inline
RuntimePath string // Path for runtime resource (default: "/svelte-runtime.js")
RuntimeCacheDuration time.Duration // Cache duration for runtime resource
// Vimesh Style settings
VimeshStyle *utils.VimeshStyleConfig // Vimesh Style configuration
VimeshStylePath string // Path for Vimesh Style resource (default: "/svelte-vimesh-style.js")
}
SvelteConfig holds all Svelte-related settings
func DefaultSvelteConfig ¶ added in v0.4.0
func DefaultSvelteConfig() *SvelteConfig
DefaultSvelteConfig returns default Svelte settings
type SvelteHandler ¶ added in v0.4.0
type SvelteHandler struct {
// contains filtered or unexported fields
}
func NewSvelteHandler ¶ added in v0.4.0
func NewSvelteHandler(fs filesystem.FileSystem) *SvelteHandler
func NewSvelteHandlerWithConfig ¶ added in v0.4.0
func NewSvelteHandlerWithConfig(fs filesystem.FileSystem, config *SvelteConfig) *SvelteHandler
func NewSvelteHandlerWithRouter ¶ added in v0.4.0
func NewSvelteHandlerWithRouter(fs filesystem.FileSystem, config *SvelteConfig, router *mux.Router) *SvelteHandler
NewSvelteHandlerWithRouter creates a SvelteHandler and registers runtime routes
func (*SvelteHandler) Handle ¶ added in v0.4.0
func (sh *SvelteHandler) Handle(route Route) http.HandlerFunc
func (*SvelteHandler) RegisterRoutes ¶ added in v0.4.0
func (sh *SvelteHandler) RegisterRoutes(router *mux.Router)
RegisterRoutes registers Svelte-related routes
func (*SvelteHandler) ServeSvelteRuntime ¶ added in v0.4.0
func (sh *SvelteHandler) ServeSvelteRuntime(w http.ResponseWriter, r *http.Request)
ServeSvelteRuntime serves the Svelte runtime as a static resource
func (*SvelteHandler) ServeVimeshStyle ¶ added in v0.4.0
func (sh *SvelteHandler) ServeVimeshStyle(w http.ResponseWriter, r *http.Request)
ServeVimeshStyle serves the Vimesh Style JavaScript as a static resource
type TemplateHandler ¶ added in v0.3.0
type TemplateHandler struct {
// contains filtered or unexported fields
}
func NewTemplateHandler ¶ added in v0.3.0
func NewTemplateHandler(fs filesystem.FileSystem) *TemplateHandler
func (*TemplateHandler) Handle ¶ added in v0.3.0
func (th *TemplateHandler) Handle(route Route) http.HandlerFunc
func (*TemplateHandler) RenderTemplate ¶ added in v0.3.0
func (th *TemplateHandler) RenderTemplate(templatePath, templateContent string, data interface{}, w http.ResponseWriter) error
RenderTemplate renders a template file with the given data
type VMManager ¶ added in v0.2.0
type VMManager struct {
// contains filtered or unexported fields
}
VMManager manages JavaScript VM creation and module initialization
func NewVMManager ¶ added in v0.2.0
func NewVMManager(fs filesystem.FileSystem, version string) *VMManager
NewVMManager creates a new VM manager