API Reference
75 modules
Auth
lib/auth_middleware.march — Session-based authentication for Bastion.
Bastion
Bastion — a plug-style HTTP web framework for March.
Bastion.Channel
lib/channel.march — Bastion.Channel: connection type and helpers for channel handlers.
Bastion.ChannelServer
lib/channel_server.march — WebSocket server for Bastion Channels.
Bastion.Cmd
lib/cmd.march — Bastion.Cmd: typed commands from island update functions.
Bastion.Dev
lib/dev.march — Bastion.Dev: development-only tools.
Bastion.ErrorOverlay
Bastion.ErrorOverlay — dev-mode error overlay.
Bastion.Health
lib/health.march — Bastion.Health: built-in health check endpoint.
Bastion.Idempotency
lib/idempotency.march — Bastion.Idempotency: idempotency-key middleware.
Bastion.IslandServer
lib/island_server.march — Bastion.IslandServer: server-push helpers for islands.
Bastion.JS
lib/js.march — Bastion.JS: WASM → JavaScript FFI interface.
Bastion.Logger
lib/logger.march — Bastion.Logger
Bastion.Metrics
lib/metrics.march — Bastion.Metrics: lightweight request metrics.
Bastion.OpenTelemetry
lib/otel.march — Bastion.OpenTelemetry: OTLP HTTP/JSON span exporter.
Bastion.PubSub
lib/pubsub.march — In-process publish/subscribe for Bastion.
Bastion.Session
Session — cookie-backed session storage for Bastion.
Bastion.Telemetry
lib/telemetry.march — Bastion.Telemetry: structured event hooks.
Bastion.Telemetry.Aggregator
lib/telemetry_aggregator.march — Bastion.Telemetry.Aggregator
Bastion.Upload
lib/upload.march — Bastion.Upload: multipart form-data upload parsing.
BastionCSP
BastionCSP: Content Security Policy nonce injection for Bastion web apps.
BastionCache
Bastion.Cache — ETag, response caching, fragment caching, and Cache-Control helpers.
BastionDepot
Bastion.Depot — database connection pool middleware.
BastionHotDeploy
BastionHotDeploy: connection-draining state machine for zero-downtime deploys.
BastionIdempotency
BastionIdempotency: idempotency-key middleware for Bastion web apps.
BastionPubSub
BastionPubSub: named PubSub instances with wildcard topic matching.
BastionRoutes
BastionRoutes: reversible routing helpers for Bastion web apps.
BastionServer
BastionServer — convenience wrappers for starting a Bastion HTTP server.
CSRF
CSRF module: Cross-Site Request Forgery protection for Bastion web apps.
Cache
lib/cache.march — Cache
CmdDepot
lib/cmd_depot.march — Bastion stub for CmdDepot (migration runner)
Conn
Bastion.Conn — higher-level helpers for the HttpServer.Conn type.
ConnStates
Bastion.ConnStates — phantom type state tags for the typed middleware pipeline.
Controller
Bastion.Controller — structured request handling with automatic error recovery.
Cors
lib/cors.march — Cors
Crypto
lib/crypto.march — Cryptographic primitives for Bastion.
Css
Css — inline style helpers for Bastion templates.
Depot.Middleware
lib/depot_middleware.march — Depot (PostgreSQL) pool integration for Bastion.
ErrorView
Bastion.ErrorView — default HTML error page rendering.
FallbackController
Bastion.FallbackController — catch-all error handler for controller actions.
Flash
Flash — one-time UI messages persisted in the session across redirects.
Forge.Assets
Forge.Assets — forge assets build / deploy / watch
Forge.BuildIslands
Forge.BuildIslands — forge bastion.build.islands
Forge.Console
Forge.Console — forge bastion.console
Forge.DepotMigrate
lib/forge/depot_migrate.march — forge bastion.depot.migrate
Forge.DepotMigrations
lib/forge/depot_migrations.march — forge bastion.depot.migrations
Forge.DepotReset
lib/forge/depot_reset.march — forge bastion.depot.reset
Forge.DepotRollback
lib/forge/depot_rollback.march — forge bastion.depot.rollback
Forge.GenChannel
Forge.GenChannel — forge bastion.gen.channel <Name>
Forge.GenHandler
Forge.GenHandler — forge bastion.gen.handler <Name> [action ...]
Forge.GenIsland
Forge.GenIsland — forge bastion.gen.island <Name>
Forge.GenMigration
Forge.GenMigration — forge bastion.gen.migration <name>
Forge.GenSchema
Forge.GenSchema — forge bastion gen schema/json/context
Forge.Lower
Forge.Lower — bastion lower CLI subcommand.
Forge.Project
Forge.Project — load and represent a Bastion project
Forge.Release
lib/forge/release.march — forge bastion.release
Forge.Routes
Forge.Routes — forge bastion routes
Forge.Server
Forge.Server — forge bastion server
Gate
Gate — changeset-style form validation for Bastion.
Hkdf
lib/hkdf.march — HKDF-SHA256 (RFC 5869) key derivation.
Html
Html — HTML safety primitives for Bastion templates.
IslandAssets
IslandAssets — serves the island client runtime and compiled WASM bundles.
IslandCss
Bastion.IslandCss — scoped CSS for WASM islands.
IslandSocket
IslandSocket — WebSocket transport for server-side island state management.
IslandView
IslandView — template helpers for embedding islands in server-rendered HTML.
Islands
Islands — hydration wrappers, registry, and dataflow helpers for Bastion WASM islands.
Middleware
Bastion.Middleware — plug-style middleware pipeline composition.
RateLimit
lib/rate_limit.march — Sliding window rate limiter for Bastion.
Registry
lib/registry.march — Registry
Request
Bastion.Request — request inspection and parsing helpers.
Response
Bastion.Response — response-building helpers.
Router
Bastion.Router — declarative, pattern-matched HTTP routing.
SecurityHeaders
lib/security_headers.march — SecurityHeaders
Static
Bastion.Static — static file serving middleware and asset tag helpers.
Test
Test module: lightweight assertion helpers for in-process testing.
TypedMiddleware
Bastion.TypedMiddleware — typed middleware pipeline for Bastion.