gowdk

package module
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2026 License: MPL-2.0 Imports: 6 Imported by: 0

README

GOWDK

A compile-first web kit for full-stack Go applications.

Write portable .gwdk pages and components, keep application logic in normal Go, and compile the result into static output, generated Go source, or a single deployable binary—without maintaining a separate JavaScript application stack.

CI Release Go License

[!WARNING] GOWDK is experimental pre-1.0 compiler/runtime software. The language, generated output, runtime contracts, and CLI may change. Generated applications are not production-ready security enforcement; review SECURITY.md before evaluating a deployment.

What GOWDK does

GOWDK gives a Go project a declarative UI layer while leaving data access, business rules, integrations, and operational code in ordinary Go packages.

  • .gwdk files declare pages, components, layouts, routes, forms, APIs, fragments, rendering behavior, and bounded client interactions.
  • The compiler discovers, parses, type-checks, and validates those declarations before generating browser assets and normal Go source.
  • Applications can emit build-time static/SPA output, opt into hybrid or SSR routes, and package supported request-time behavior into a Go binary.
  • Generated code and build metadata remain inspectable. Core builds use the Go toolchain; Tailwind and other external tools are explicit, optional choices.
  • Browser runtime code is generated by GOWDK. Go/WASM islands are explicit rather than the default component model.

Quick start

GOWDK currently requires Go 1.26.4.

Install through the Go module checksum system:

go install github.com/cssbruno/gowdk/cmd/gowdk@latest
gowdk version

For reproducible installs, replace latest with an exact published tag. A convenience installer is also available for supported Linux and macOS targets:

curl -fsSL https://raw.githubusercontent.com/cssbruno/GoWDK/main/scripts/install.sh | sh

The installer verifies the downloaded release binary against checksums.txt; the bootstrap script itself is fetched from the mutable main branch. See Getting Started for exact artifact and attestation verification.

Create, verify, build, and run an application:

gowdk init --tests --template site my-app
cd my-app

gowdk check
gowdk build
gowdk test
./bin/site

Open http://127.0.0.1:8080/. During development, use:

gowdk dev

The dev loop rebuilds changed inputs, serves the last successful build after an error, and supports browser live reload.

A .gwdk page

package app

route "/"
guard public
css default page

build {
  => { title: "Hello from GOWDK" }
}

view {
  <main class="home">
    <h1>{title}</h1>
    <p>Compiled from a .gwdk page and served by Go.</p>
  </main>
}

Pages can call declared components, bind build-time data returned by Go, declare form actions and API routes, render fragments, or opt into request-time loading. Domain behavior stays in exported Go functions with compiler-validated signatures.

Compilation model

.gwdk sources + gowdk.config.go + normal Go packages
                         |
                 discover / parse
                         |
                typed AST and IR
                         |
              validate all contracts
                         |
          +--------------+---------------+
          |              |               |
    static/SPA      generated Go      reports and
      output            app           manifests
                             |
                          go build
                             |
                   deployable Go binary

GOWDK supports three page rendering lanes:

Lane Behavior
Static/SPA Produces build-time HTML/app output and supported client navigation.
Hybrid Stays build-time by default and adds request-time behavior only when declared.
SSR Produces full page HTML at request time through the SSR addon.

Capabilities

Area Current surface
UI Pages, components, layouts, slots, scoped assets, CSS, literal dynamic paths, and build-time data.
Backend Form actions, typed inputs, redirects, fragments, APIs, guards, request-time page loaders, and panic boundaries.
Go interoperability Imported build functions, normal handler packages, database/sql or any Go data layer, lifecycle services, and generated adapter validation.
Packaging Static output, generated app source, embedded assets, local binaries, optional Docker files, deploy recipe starters, and Go js/wasm artifacts.
Extensions Built-in feature addons for SSR, actions, APIs, partials, CSS/Tailwind, SEO, auth, DB plumbing, contracts, realtime, rate limiting, and observability.
Tooling Scaffolding, formatting, diagnostics, safe fixes, tests, security audits, route and graph inspection, development serving, preview, LSP, and a VS Code extension.

The broad surface is intentional, but maturity is not uniform. Richer client-side reactivity, hybrid streaming, browser-owned server-data refresh, non-HTTP revalidation, scheduler policy, authentication hardening, and parts of the production security model remain partial or application-owned.

Generated project layout

The default site scaffold starts with:

my-app/
├── gowdk.config.go
├── src/
│   ├── pages/home.page.gwdk
│   └── components/hero.cmp.gwdk
├── styles/global.css
├── tests/gowdk_smoke_test.go
└── go.mod

A configured build target then produces:

.gowdk/output/site/   # HTML, assets, route metadata, and build report
.gowdk/site/          # generated, inspectable Go application
bin/site              # deployable binary with embedded output

Generated directories should not be edited by hand.

Everyday CLI

Command Purpose
gowdk init Scaffold a site or minimal application.
gowdk dev Rebuild, serve, restart generated apps when needed, and live reload.
gowdk build Compile selected sources and configured targets.
gowdk preview Build and serve a one-shot deployment preview.
gowdk check Parse and validate .gwdk sources.
gowdk fmt --write Format .gwdk files.
gowdk test Run Go tests against generated application artifacts.
gowdk doctor Check the local toolchain and project health.
gowdk audit Evaluate the generated application's declared security posture.
gowdk inspect Inspect compiler IR, trees, endpoint graphs, assets, and Go bindings.
gowdk routes / endpoints Print generated route and endpoint metadata.
gowdk lsp Start the language server over stdio.

Run gowdk --help or gowdk <command> --help for the complete command surface.

Addons

Capabilities are enabled explicitly in gowdk.config.go. The CLI can list and wire supported built-in addons:

gowdk add --list
gowdk add --list --registry
gowdk add ssr actions api
gowdk add seo --base-url https://example.com

GOWDK does not silently download external tools, scan GitHub for addons, or execute unknown addon code. External modules and tools remain normal, application-owned dependencies. See the addons reference.

Deployment

A generated binary serves embedded frontend output plus the supported actions, APIs, fragments, guards, hybrid routes, and SSR routes compiled into it. Generated binaries speak HTTP; TLS and public routing normally belong to a reverse proxy such as Caddy or Nginx.

gowdk build can also emit Docker support and starter deployment recipes:

gowdk build --docker
gowdk build --deploy-recipe caddy

Available recipe families include caddy, nginx, split, static, and systemd. See Deployment for output models, reverse proxies, environment contracts, and operational guidance.

Documentation

Start with the Documentation Hub, which maps each question to its authoritative source and explains how current contracts, specifications, plans, ADRs, and release history differ.

Need Start here
First application Getting Started, Native Learning Path, and Cookbook
.gwdk language Language Index
Commands, config, runtime, and integrations Reference Index
Compiler pipeline and generated output Compiler Index
Capability status and product direction Product Index
Architecture, security, operations, and contribution standards Engineering Index
Security and release history Security Policy and Changelog

Runnable projects live under examples/. The examples/flagship/ project crosses most supported application surfaces in one generated application.

Contributing

GOWDK is early-stage compiler infrastructure. Keep changes focused, update the relevant contract documentation, and run at least:

go test ./...
go build ./cmd/gowdk

See Contributing for repository workflow, documentation ownership, and verification expectations.

License

GOWDK is licensed under the Mozilla Public License 2.0.

Documentation

Index

Constants

View Source
const DefaultCSRFSecretEnv = "GOWDK_CSRF_SECRET"
View Source
const DefaultRequestBodyLimitBytes int64 = 1 << 20

DefaultRequestBodyLimitBytes is the default generated request body cap for action and API endpoints.

Variables

This section is empty.

Functions

This section is empty.

Types

type Addon

type Addon interface {
	Name() string
	Features() []Feature
}

Addon is the minimal contract every optional GOWDK capability implements.

func NewAddon

func NewAddon(name string, features ...Feature) Addon

NewAddon creates a simple addon declaration for capability registration.

type AssetMode

type AssetMode string

AssetMode controls how frontend artifacts are shipped.

const (
	AssetExternal AssetMode = "external"
	Embed         AssetMode = "embed"
)

type AuthSessionOptions added in v0.7.0

type AuthSessionOptions struct {
	SecretEnv  string
	CookieName string
	TTL        time.Duration
	Insecure   bool
}

AuthSessionOptions is the generated-app-safe subset of auth session configuration. Secret values stay out of compiler config; generated apps read them from SecretEnv at runtime.

type AuthSessionProvider added in v0.7.0

type AuthSessionProvider interface {
	AuthSessionOptions() AuthSessionOptions
}

AuthSessionProvider is implemented by auth addons that can supply generated app session setup. The compiler uses it to wire built-in auth guard backing code without requiring per-app hooks.

type BodyLimitsConfig added in v0.5.0

type BodyLimitsConfig struct {
	ActionBytes int64
	APIBytes    int64
}

BodyLimitsConfig controls generated request body caps. Omitted or non-positive values use the default 1 MiB cap.

func (BodyLimitsConfig) APILimitBytes added in v0.5.0

func (config BodyLimitsConfig) APILimitBytes() int64

APILimitBytes returns the configured API body cap or the default cap.

func (BodyLimitsConfig) ActionLimitBytes added in v0.5.0

func (config BodyLimitsConfig) ActionLimitBytes() int64

ActionLimitBytes returns the configured action body cap or the default cap.

type BuildConfig

type BuildConfig struct {
	Output              string
	Mode                BuildMode
	Assets              AssetMode
	ObfuscateAssets     bool
	Head                HeadConfig
	CSRF                CSRFConfig
	CORS                CORSConfig
	SecurityHeaders     SecurityHeadersConfig
	BodyLimits          BodyLimitsConfig
	AllowMissingBackend bool
	Stylesheets         []Stylesheet
	Scripts             []Script
	Worker              ContractWorkerConfig
	Cron                ContractCronConfig
	Targets             []BuildTargetConfig
}

BuildConfig controls output artifacts and frontend asset packaging.

func (BuildConfig) DebugAssets

func (config BuildConfig) DebugAssets() bool

DebugAssets reports whether generated frontend artifacts should include debugging metadata.

func (BuildConfig) ObfuscatesAssets added in v0.5.0

func (config BuildConfig) ObfuscatesAssets() bool

ObfuscatesAssets reports whether compiler-owned generated browser assets should be transformed for production output.

type BuildMode

type BuildMode string

BuildMode controls whether generated frontend artifacts include development metadata such as source maps. Development is the default when omitted.

const (
	Development BuildMode = "development"
	Production  BuildMode = "production"
)

type BuildParams added in v0.7.0

type BuildParams struct {
	Route  map[string]string `json:"route,omitempty"`
	Locale string            `json:"locale,omitempty"`
}

BuildParams carries compile-time route values into Go build helpers.

func (BuildParams) LocaleCode added in v0.8.0

func (params BuildParams) LocaleCode() string

LocaleCode returns the active build locale, when localized route generation is enabled.

func (BuildParams) Param added in v0.7.0

func (params BuildParams) Param(name string) (string, bool)

Param returns a declared dynamic route param by name.

func (BuildParams) RouteParams added in v0.7.0

func (params BuildParams) RouteParams() map[string]string

RouteParams returns a copy of the declared route params.

type BuildTargetConfig

type BuildTargetConfig struct {
	Name          string
	Modules       []string
	Output        string
	App           string
	Binary        string
	WASM          string
	BackendApp    string
	BackendBinary string
	WorkerApp     string
	WorkerBinary  string
	Worker        ContractWorkerConfig
	CronApp       string
	CronBinary    string
	Cron          ContractCronConfig
	DeployRecipes []string
}

BuildTargetConfig declares one configured build target. Modules selects the configured source modules compiled into Output, App, Binary, WASM, BackendApp, BackendBinary, and optional deployment recipes.

type CORSConfig added in v0.8.0

type CORSConfig struct {
	Enabled          bool
	AllowedOrigins   []string
	AllowedMethods   []string
	AllowedHeaders   []string
	ExposedHeaders   []string
	AllowCredentials bool
	MaxAgeSeconds    int
}

CORSConfig controls generated CORS headers and preflight handling for API and web contract endpoints. It is disabled by default, so generated endpoints remain same-origin unless a policy is declared.

func (CORSConfig) EnabledForGeneratedAPIs added in v0.8.0

func (config CORSConfig) EnabledForGeneratedAPIs() bool

EnabledForGeneratedAPIs reports whether generated API/contract routes should install CORS handling.

func (CORSConfig) Validate added in v0.8.0

func (config CORSConfig) Validate() error

Validate checks structural safety rules for the generated CORS policy.

type CSRFConfig added in v0.1.5

type CSRFConfig struct {
	Enabled    bool
	Disabled   bool
	SecretEnv  string
	CookieName string
	FieldName  string
	HeaderName string
	Insecure   bool
}

CSRFConfig controls generated CSRF token wiring for browser-reachable state-changing endpoints.

func (CSRFConfig) EnabledForGeneratedEndpoints added in v0.5.0

func (config CSRFConfig) EnabledForGeneratedEndpoints() bool

EnabledForGeneratedEndpoints reports whether generated state-changing endpoints should emit CSRF token injection and validation. CSRF is on by default; Disabled is the explicit opt-out. Enabled is retained for older configs that already set it.

func (CSRFConfig) SecretEnvName added in v0.1.5

func (config CSRFConfig) SecretEnvName() string

SecretEnvName returns the environment variable used by generated apps to read the CSRF signing secret.

type CSSAsset

type CSSAsset struct {
	Path     string
	Contents []byte
}

CSSAsset is a CSS file emitted by a compile-time CSS processor.

type CSSConfig

type CSSConfig struct {
	Include []string
	Exclude []string
	Default []string
	Output  CSSOutputConfig
}

CSSConfig controls discovered CSS inputs and page CSS output.

type CSSContext

type CSSContext struct {
	Sources   []CSSSource
	OutputDir string
	Build     BuildConfig
	CSS       CSSConfig
}

CSSContext is passed to compile-time CSS processors.

type CSSOutputConfig

type CSSOutputConfig struct {
	Dir        string
	HrefPrefix string
}

CSSOutputConfig controls generated page stylesheet locations.

type CSSProcessor

type CSSProcessor interface {
	Addon
	ProcessCSS(CSSContext) (CSSResult, error)
}

CSSProcessor is implemented by addons that emit CSS at build time.

type CSSResult

type CSSResult struct {
	Assets          []CSSAsset
	Stylesheets     []Stylesheet
	PageStylesheets map[string][]Stylesheet
}

CSSResult is returned by compile-time CSS processors.

type CSSSource

type CSSSource struct {
	Path       string
	Kind       string
	Name       string
	CSSClasses []string
}

CSSSource describes one discovered source file for compile-time CSS plugins.

type Config

type Config struct {
	AppName   string
	Source    SourceConfig
	Modules   []ModuleConfig
	Render    RenderConfig
	I18N      I18NConfig
	Env       EnvConfig
	Lifecycle LifecycleConfig
	Build     BuildConfig
	CSS       CSSConfig
	Addons    []Addon
}

Config describes how a GOWDK application should be discovered, compiled, and packaged.

func (Config) HasFeature

func (config Config) HasFeature(feature Feature) bool

HasFeature reports whether a config enables a feature through an addon.

type ContractCronConfig added in v0.12.0

type ContractCronConfig struct {
	Jobs []ContractCronJobConfig
}

ContractCronConfig controls generated standalone scheduled job targets.

type ContractCronJobConfig added in v0.12.0

type ContractCronJobConfig struct {
	Type            string
	Schedule        string
	OverlapPolicy   string
	MissedRunPolicy string
}

ContractCronJobConfig declares one generated cron role job. Type accepts the scanned job type name, package-qualified name, or full import-path-qualified name. Schedule currently supports @once and @every <duration>.

type ContractWorkerConfig added in v0.12.0

type ContractWorkerConfig struct {
	EventSource ServiceRef
	SeenStore   ServiceRef
	Backoff     ServiceRef
}

ContractWorkerConfig controls generated standalone contract worker targets. EventSource is required and must name a function returning (contracts.EventSource, error). SeenStore and Backoff are optional provider hooks returning (contracts.SeenStore, error) and (contracts.EventWorkerBackoff, error).

type EnvConfig added in v0.2.7

type EnvConfig struct {
	Vars    []EnvVar
	Secrets []SecretEnv
}

EnvConfig declares the runtime environment contract for generated apps. It names expected variables and secrets, but never stores secret values.

func (EnvConfig) Validate added in v0.2.7

func (config EnvConfig) Validate(lookup func(string) (string, bool)) error

Validate checks the env contract. If lookup is nil, only structural rules are checked. If lookup is provided, required missing names are reported too.

type EnvValidationError added in v0.2.7

type EnvValidationError struct {
	Code    string
	Name    string
	Message string
}

EnvValidationError describes one invalid or missing env contract entry.

func (EnvValidationError) Error added in v0.2.7

func (err EnvValidationError) Error() string

type EnvValidationErrors added in v0.2.7

type EnvValidationErrors []EnvValidationError

EnvValidationErrors is a list of env contract validation failures.

func (EnvValidationErrors) Error added in v0.2.7

func (errs EnvValidationErrors) Error() string

type EnvVar added in v0.2.7

type EnvVar struct {
	Name     string
	Required bool
	Default  string
}

EnvVar declares a normal non-secret environment variable. Defaults must only be used for safe non-secret local or runtime values.

type Feature

type Feature string

Feature names the capabilities that addons make available to the compiler.

const (
	FeatureSPA           Feature = "spa"
	FeatureActions       Feature = "actions"
	FeaturePartial       Feature = "partial"
	FeatureSSR           Feature = "ssr"
	FeatureAPI           Feature = "api"
	FeatureEmbed         Feature = "embed"
	FeatureCSS           Feature = "css"
	FeatureRateLimit     Feature = "ratelimit"
	FeatureContracts     Feature = "contracts"
	FeatureRealtime      Feature = "realtime"
	FeatureAuth          Feature = "auth"
	FeatureDB            Feature = "db"
	FeatureSEO           Feature = "seo"
	FeatureObservability Feature = "observability"
)

type FeatureSet

type FeatureSet map[Feature]bool

FeatureSet is a lookup table of enabled addon capabilities.

func EnabledFeatures

func EnabledFeatures(config Config) FeatureSet

EnabledFeatures returns the set of capabilities enabled by a config.

func (FeatureSet) Has

func (features FeatureSet) Has(feature Feature) bool

Has reports whether a feature is present in the set.

type GoBlockConsumer added in v0.1.5

type GoBlockConsumer interface {
	GoBlockTargets() []string
	ValidateGoBlock(target GoBlockTarget, context GoBlockContext) []GoBlockDiagnostic
	GeneratedGo(target GoBlockTarget, context GoBlockContext) ([]GoBlockFile, error)
}

GoBlockConsumer is an optional addon extension point for targeted go blocks such as go addon.contracts {}.

type GoBlockContext added in v0.1.5

type GoBlockContext struct {
	Render RenderMode
}

GoBlockContext describes the compiler lane that owns a go block target.

type GoBlockDiagnostic added in v0.1.5

type GoBlockDiagnostic struct {
	Code    string
	Message string
	Span    SourceSpan
}

GoBlockDiagnostic is an addon-produced diagnostic for a go block target.

type GoBlockFile added in v0.1.5

type GoBlockFile struct {
	Path    string
	Source  string
	Package string
}

GoBlockFile is a generated file emitted by an addon go block consumer. Path is relative to the generated app directory.

type GoBlockTarget added in v0.1.5

type GoBlockTarget struct {
	Target       string
	OwnerKind    string
	OwnerID      string
	OwnerPackage string
	SourcePath   string
	Body         string
	Span         SourceSpan
}

GoBlockTarget describes one parsed go block passed to an addon.

type HeadConfig added in v0.1.5

type HeadConfig struct {
	SiteName    string
	Favicon     string
	Image       string
	TwitterCard string
}

HeadConfig controls app-level document head tags emitted around page metadata.

type I18NConfig added in v0.8.0

type I18NConfig struct {
	Locales           []LocaleConfig
	DefaultLocale     string
	OmitDefaultPrefix bool
}

I18NConfig controls locale-aware route generation. When Locales is empty, GOWDK emits the existing single-locale routes.

func (I18NConfig) DefaultLocaleCode added in v0.8.0

func (config I18NConfig) DefaultLocaleCode() string

DefaultLocaleCode returns the configured default locale or the first locale.

func (I18NConfig) Enabled added in v0.8.0

func (config I18NConfig) Enabled() bool

Enabled reports whether localized route generation is configured.

func (I18NConfig) LocaleCodes added in v0.8.0

func (config I18NConfig) LocaleCodes() []string

LocaleCodes returns configured locale codes in declaration order.

func (I18NConfig) LocalizeRoute added in v0.8.0

func (config I18NConfig) LocalizeRoute(route string, locale string) string

LocalizeRoute applies the configured path-prefix policy for one locale.

func (I18NConfig) LocalizedRoutes added in v0.8.0

func (config I18NConfig) LocalizedRoutes(route string) []LocalizedRoute

LocalizedRoutes returns the concrete route variants for the configured locale policy. With no locale policy it returns the original route.

func (I18NConfig) PathPrefix added in v0.8.0

func (config I18NConfig) PathPrefix(locale string) string

PathPrefix returns the normalized route prefix for one configured locale.

func (I18NConfig) Validate added in v0.8.0

func (config I18NConfig) Validate() error

Validate checks the locale route policy.

type LifecycleConfig added in v0.7.0

type LifecycleConfig struct {
	Services []ServiceRef
}

LifecycleConfig declares process-level services that the generated binary starts alongside the generated web app.

func (LifecycleConfig) Validate added in v0.7.0

func (config LifecycleConfig) Validate() error

Validate checks the structural lifecycle contract. Provider symbol existence and signatures are verified by the generated app Go build.

type LocaleConfig added in v0.8.0

type LocaleConfig struct {
	Code       string
	PathPrefix string
	Name       string
}

LocaleConfig declares one locale available to build-time and request-time generated routes. PathPrefix is optional; when omitted, "/<Code>" is used.

type LocalizedRoute added in v0.8.0

type LocalizedRoute struct {
	Locale string
	Route  string
}

LocalizedRoute describes one locale-expanded route.

type ModuleConfig

type ModuleConfig struct {
	Name   string
	Type   string
	Source SourceConfig
}

ModuleConfig names a source group inside a GOWDK app. Build discovery uses selected module sources to decide what gets compiled into output, generated apps, and generated binaries. Type is user-defined metadata.

type RenderConfig

type RenderConfig struct {
	Default RenderMode
}

RenderConfig controls default render behavior. SPA is the default when omitted.

func (RenderConfig) DefaultMode

func (config RenderConfig) DefaultMode() RenderMode

DefaultMode returns SPA when no explicit default render mode is set.

type RenderMode

type RenderMode string

RenderMode describes where full-page HTML is produced.

const (
	// SPA emits a non-SSR app shell and client-side route experience.
	SPA RenderMode = "spa"
	// Hybrid allows a route to combine app output and request-time behavior.
	Hybrid RenderMode = "hybrid"
	// SSR renders full pages at request time through the SSR addon.
	SSR RenderMode = "ssr"
)

func ParseRenderMode

func ParseRenderMode(value string) (RenderMode, error)

ParseRenderMode validates a render mode from source.

func (RenderMode) IsBuildTime

func (mode RenderMode) IsBuildTime() bool

IsBuildTime reports whether this mode is always build-time. Hybrid defaults to build-time unless explicit request-time capabilities are declared.

func (RenderMode) RequiresSSR

func (mode RenderMode) RequiresSSR() bool

RequiresSSR reports whether this mode always needs the SSR addon. Hybrid pages need SSR only when they declare explicit request-time capabilities.

type SEODynamicSitemap added in v0.10.0

type SEODynamicSitemap struct {
	ImportPath   string
	Function     string
	MaxURLs      int
	CacheSeconds int
}

SEODynamicSitemap configures an app-owned request-time sitemap provider for generated binaries. ImportPath and Function name a Go function with the signature:

func(context.Context) ([]seo.URL, error)

The generated handler combines those URLs with build-time public URLs.

type SEOOptions added in v0.5.0

type SEOOptions struct {
	BaseURL          string
	Disallow         []string
	ExtraURLs        []SEOURL
	ExtraURLProvider func() []SEOURL `json:"-"`
	DynamicSitemap   SEODynamicSitemap
}

SEOOptions configures build-time sitemap.xml and robots.txt emission.

type SEOProvider added in v0.5.0

type SEOProvider interface {
	SEOOptions() SEOOptions
}

SEOProvider is implemented by addons that can supply build-time SEO output options to the compiler.

type SEOURL added in v0.5.0

type SEOURL = runtimeseo.URL

SEOURL describes one additional URL that an SEO addon can add to the generated sitemap. Loc may be absolute or root-relative.

type Script added in v0.2.1

type Script struct {
	Src  string
	Type string
}

Script describes one script tag emitted into generated HTML. Type is optional; use "module" for ES module bundles.

type SecretEnv added in v0.2.7

type SecretEnv struct {
	Name     string
	Required bool
	// MinBytes rejects a present-but-too-short secret at build time and at
	// generated-app startup. Zero means no minimum. This lets the env contract
	// fail fast on a weak signing key instead of deferring the failure to the
	// first request that constructs the signer.
	MinBytes int
}

SecretEnv declares a secret environment variable. Secret values intentionally have no config field and must come from the runtime environment.

type SecurityHeadersConfig added in v0.5.0

type SecurityHeadersConfig struct {
	Enabled bool
	Headers map[string]string
}

SecurityHeadersConfig declares generated runtime response headers. Audit policy can require these headers statically, and generated audit tests can verify that the handler emits them.

type ServiceRef added in v0.7.0

type ServiceRef struct {
	ImportPath string
	Function   string
}

ServiceRef names a package-level provider imported by the generated app. Function must have signature:

func() ([]runtime/app.Service, error)

type SourceConfig

type SourceConfig struct {
	Include []string
	Exclude []string
}

SourceConfig selects portable .gwdk files for discovery.

type SourcePosition added in v0.1.5

type SourcePosition struct {
	Line   int
	Column int
}

SourcePosition is a 1-based source location exposed to addon go block consumers.

type SourceSpan added in v0.1.5

type SourceSpan struct {
	Start SourcePosition
	End   SourcePosition
}

SourceSpan is a 1-based source range exposed to addon go block consumers.

type Stylesheet

type Stylesheet struct {
	Href string
}

Stylesheet describes one stylesheet link emitted into generated HTML.

Directories

Path Synopsis
addons
api
auth
Package auth is the batteries-included GOWDK authentication addon.
Package auth is the batteries-included GOWDK authentication addon.
contracts
Package contracts declares the contract-driven runtime compiler capability.
Package contracts declares the contract-driven runtime compiler capability.
css
Package css registers compile-time CSS extension support.
Package css registers compile-time CSS extension support.
db
Package db is the GOWDK database plumbing addon.
Package db is the GOWDK database plumbing addon.
observability
Package observability declares the optional GOWDK Trace compiler/runtime capability and re-exports dependency-free runtime trace helpers.
Package observability declares the optional GOWDK Trace compiler/runtime capability and re-exports dependency-free runtime trace helpers.
realtime
Package realtime declares the browser presentation-event realtime compiler capability and exposes dependency-free SSE helpers.
Package realtime declares the browser presentation-event realtime compiler capability and exposes dependency-free SSE helpers.
seo
spa
ssr
static
Package static marks build-time static page output responsibilities.
Package static marks build-time static page output responsibilities.
tailwind
Package tailwind integrates Tailwind CSS v4 through the standalone CLI.
Package tailwind integrates Tailwind CSS v4 through the standalone CLI.
cmd
gowdk command
examples
auth-guard command
contracts command
css command
endpoints command
flagship command
login command
seo
store-persist/ui
Package ui holds the user-owned Go state for the store-persistence example.
Package ui holds the user-owned Go state for the store-persistence example.
tailwind command
internal
appgen
Package appgen emits a generated Go app that embeds build output.
Package appgen emits a generated Go app that embeds build output.
auditsarif
Package auditsarif renders gowdk audit findings as SARIF 2.1.0, the format GitHub code scanning ingests.
Package auditsarif renders gowdk audit findings as SARIF 2.1.0, the format GitHub code scanning ingests.
auditschema
Package auditschema publishes the versioned JSON Schema contracts for the gowdk audit report (`gowdk audit --json`) and the security manifest (gowdk-security.json).
Package auditschema publishes the versioned JSON Schema contracts for the gowdk audit report (`gowdk audit --json`) and the security manifest (gowdk-security.json).
auditspec
Package auditspec is the policy model and evaluation engine for gowdk audit.
Package auditspec is the policy model and evaluation engine for gowdk audit.
buildgen
Package buildgen emits app-shell HTML artifacts for build-time pages.
Package buildgen emits app-shell HTML artifacts for build-time pages.
clientlang
Package clientlang parses GOWDK component-local client handlers.
Package clientlang parses GOWDK component-local client handlers.
clientrt
Package clientrt embeds framework-owned browser runtime sources and renders the small generated templates consumed by buildgen.
Package clientrt embeds framework-owned browser runtime sources and renders the small generated templates consumed by buildgen.
contractscan
Package contractscan discovers runtime contract registrations in normal Go source using the standard Go AST.
Package contractscan discovers runtime contract registrations in normal Go source using the standard Go AST.
cssscope
Package cssscope builds deterministic scope and hash metadata for scoped CSS.
Package cssscope builds deterministic scope and hash metadata for scoped CSS.
discover
Package discover finds portable .gwdk files from source include patterns.
Package discover finds portable .gwdk files from source include patterns.
doclint command
Command doclint checks local Markdown links and heading anchors across the repository without any network access.
Command doclint checks local Markdown links and heading anchors across the repository without any network access.
goblockgen
Package goblockgen turns captured go blocks into normal generated Go package source used by build and app generation.
Package goblockgen turns captured go blocks into normal generated Go package source used by build and app generation.
gotypes
Package gotypes resolves Go contracts referenced from .gwdk component files.
Package gotypes resolves Go contracts referenced from .gwdk component files.
gwdkast
Package gwdkast defines the typed syntax tree for .gwdk source files.
Package gwdkast defines the typed syntax tree for .gwdk source files.
gwdkir
Package gwdkir defines the stable internal representation shared by GOWDK compiler passes after .gwdk AST analysis.
Package gwdkir defines the stable internal representation shared by GOWDK compiler passes after .gwdk AST analysis.
lsp
Package lsp implements the GOWDK Language Server Protocol entrypoint.
Package lsp implements the GOWDK Language Server Protocol entrypoint.
parser
Package parser turns .gwdk source files into syntax trees.
Package parser turns .gwdk source files into syntax trees.
project
Package project loads project-level compiler configuration.
Package project loads project-level compiler configuration.
safeasset
Package safeasset centralizes checks for files that must not be copied into generated public or embedded output.
Package safeasset centralizes checks for files that must not be copied into generated public or embedded output.
securitymanifest
Package securitymanifest projects the stable compiler IR into a declarative, machine-readable security posture (gowdk-security.json).
Package securitymanifest projects the stable compiler IR into a declarative, machine-readable security posture (gowdk-security.json).
securitytext
Package securitytext wraps runtime security text helpers for compiler-private callers.
Package securitytext wraps runtime security text helpers for compiler-private callers.
source
Package source holds the neutral leaf value types shared across the GOWDK compiler packages: source spans, route params, inline scripts, and backend binding metadata.
Package source holds the neutral leaf value types shared across the GOWDK compiler packages: source spans, route params, inline scripts, and backend binding metadata.
syntax
Package syntax is the leaf lexer + recursive-descent parser for .gwdk source.
Package syntax is the leaf lexer + recursive-descent parser for .gwdk source.
viewrender
Package viewrender renders the supported view {} markup subset.
Package viewrender renders the supported view {} markup subset.
runtime
adapters
Package adapters provides framework-neutral helpers used by optional framework adapter modules.
Package adapters provides framework-neutral helpers used by optional framework adapter modules.
api
app
contracts
Package contracts provides the local typed contract registry used by GOWDK runtime roles.
Package contracts provides the local typed contract registry used by GOWDK runtime roles.
contracts/fileoutbox
Package fileoutbox provides a dependency-free JSON Lines outbox adapter for runtime/contracts.
Package fileoutbox provides a dependency-free JSON Lines outbox adapter for runtime/contracts.
contracts/membroker
Package membroker provides an in-memory broker adapter for runtime/contracts.
Package membroker provides an in-memory broker adapter for runtime/contracts.
contracts/sse
Package sse provides a dependency-free server-sent events presentation fanout adapter for runtime/contracts.
Package sse provides a dependency-free server-sent events presentation fanout adapter for runtime/contracts.
envfile
Package envfile loads simple dotenv-style files without overriding process environment values.
Package envfile loads simple dotenv-style files without overriding process environment values.
i18n
Package i18n provides dependency-free typed message catalog helpers.
Package i18n provides dependency-free typed message catalog helpers.
ratelimit
Package ratelimit provides HTTP rate limiting for generated or user-owned request-time handlers.
Package ratelimit provides HTTP rate limiting for generated or user-owned request-time handlers.
realtime
Package realtime provides request-time presentation-event fanout helpers for generated apps.
Package realtime provides request-time presentation-event fanout helpers for generated apps.
render
Package render provides core HTML rendering primitives shared by build-time output, actions, fragments, and request-time page rendering.
Package render provides core HTML rendering primitives shared by build-time output, actions, fragments, and request-time page rendering.
security
Package security contains conservative runtime security helpers.
Package security contains conservative runtime security helpers.
seo
ssr
testkit
Package testkit provides small helpers for generated runtime integration tests.
Package testkit provides small helpers for generated runtime integration tests.
trace
Package trace provides a dependency-free tracing core for GOWDK Runtime and plain Go applications.
Package trace provides a dependency-free tracing core for GOWDK Runtime and plain Go applications.
wasm
Package wasm provides helpers for browser WASM island exports.
Package wasm provides helpers for browser WASM island exports.
testfixture

Jump to

Keyboard shortcuts

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