Documentation
¶
Index ¶
- type CachedModule
- 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 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 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 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