web

package
v0.0.11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 9, 2025 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AdminLogsHandler

func AdminLogsHandler(logger *engine.RequestLogger) http.HandlerFunc

AdminLogsHandler serves the admin logs page using templ

func DocsAPIHandler

func DocsAPIHandler() http.HandlerFunc

DocsAPIHandler handles requests for documentation and code examples

func DocsHandler

func DocsHandler() http.HandlerFunc

DocsHandler handles documentation page requests

func DynamicRouteHandler

func DynamicRouteHandler(jsEngine *engine.Engine) http.HandlerFunc

DynamicRouteHandler wraps the existing HandleDynamicRoute function

func ExecuteREPLHandler

func ExecuteREPLHandler(jsEngine *engine.Engine) http.HandlerFunc

ExecuteREPLHandler handles REPL execution (non-persistent)

func GetStaticFS

func GetStaticFS() embed.FS

GetStaticFS returns the embedded static filesystem for debugging

func HandleDynamicRoute

func HandleDynamicRoute(jsEngine *engine.Engine, w http.ResponseWriter, r *http.Request)

HandleDynamicRoute processes requests for JavaScript-registered handlers

func HistoryHandler

func HistoryHandler(jsEngine *engine.Engine) http.HandlerFunc

HistoryHandler serves the execution history page

func HomeHandler

func HomeHandler() http.HandlerFunc

HomeHandler redirects to playground

func PlaygroundHandler

func PlaygroundHandler() http.HandlerFunc

PlaygroundHandler serves the JavaScript playground page

func PresetHandler

func PresetHandler() http.HandlerFunc

PresetHandler returns preset examples as JSON

func REPLHandler

func REPLHandler() http.HandlerFunc

REPLHandler serves the REPL page

func ResetVMHandler

func ResetVMHandler(jsEngine *engine.Engine) http.HandlerFunc

ResetVMHandler resets the JavaScript VM state

func ScriptsHandler

func ScriptsHandler(jsEngine *engine.Engine) http.HandlerFunc

ScriptsHandler creates a handler for the script viewer page

func SetupAdminRoutes

func SetupAdminRoutes(r *mux.Router, jsEngine *engine.Engine)

SetupAdminRoutes configures all admin routes on the given router

func SetupAdminServerRoutes

func SetupAdminServerRoutes(jsEngine *engine.Engine) *mux.Router

SetupAdminServerRoutes sets up routes for the admin/system interface

func SetupDynamicRoutes

func SetupDynamicRoutes(r *mux.Router, jsEngine *engine.Engine)

SetupDynamicRoutes configures the dynamic JavaScript-handled routes with request logging

func SetupFullServer

func SetupFullServer(jsEngine *engine.Engine) *mux.Router

SetupFullServer configures a complete server with all routes

func SetupJSRoutes

func SetupJSRoutes(jsEngine *engine.Engine) *mux.Router

SetupJSRoutes sets up routes for the JavaScript web server (user-facing)

func SetupRoutes

func SetupRoutes(jsEngine *engine.Engine) *mux.Router

SetupRoutes sets up the web routes (legacy compatibility)

func SetupRoutesWithAPI

func SetupRoutesWithAPI(jsEngine *engine.Engine, executeHandler http.HandlerFunc) *mux.Router

SetupRoutesWithAPI sets up admin routes including the execute API handler

func StaticHandler

func StaticHandler() http.Handler

StaticHandler serves static files with correct MIME types

Types

type AdminHandler

type AdminHandler struct {
	// contains filtered or unexported fields
}

AdminHandler provides admin endpoints for managing the server

func NewAdminHandler

func NewAdminHandler(logger *engine.RequestLogger, repos repository.RepositoryManager, jsEngine *engine.Engine) *AdminHandler

NewAdminHandler creates a new admin handler

func (*AdminHandler) HandleAdminLogs

func (ah *AdminHandler) HandleAdminLogs(w http.ResponseWriter, r *http.Request)

HandleAdminLogs serves the admin logs interface

func (*AdminHandler) HandleGlobalState

func (ah *AdminHandler) HandleGlobalState(w http.ResponseWriter, r *http.Request)

HandleGlobalState serves the globalState interface and API

func (*AdminHandler) HandleStaticFiles

func (ah *AdminHandler) HandleStaticFiles(w http.ResponseWriter, r *http.Request)

HandleStaticFiles serves admin static files

type CodeExample

type CodeExample struct {
	ID          string `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description"`
	Code        string `json:"code"`
	Source      string `json:"source"`   // Which file it came from
	Category    string `json:"category"` // Type of example
}

CodeExample represents a JavaScript code example extracted from docs

type DocInfo

type DocInfo struct {
	Filename string
	Title    string
	Content  string
}

Directories

Path Synopsis
templ: version: v0.3.894
templ: version: v0.3.894

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL