Documentation
¶
Index ¶
- Constants
- type Addon
- type AssetMode
- type BuildConfig
- type BuildMode
- type BuildTargetConfig
- type CSRFConfig
- type CSSAsset
- type CSSConfig
- type CSSContext
- type CSSOutputConfig
- type CSSProcessor
- type CSSResult
- type CSSSource
- type Config
- type EnvConfig
- type EnvValidationError
- type EnvValidationErrors
- type EnvVar
- type Feature
- type FeatureSet
- type GoBlockConsumer
- type GoBlockContext
- type GoBlockDiagnostic
- type GoBlockFile
- type GoBlockTarget
- type HeadConfig
- type ModuleConfig
- type RenderConfig
- type RenderMode
- type Script
- type SecretEnv
- type SourceConfig
- type SourcePosition
- type SourceSpan
- type Stylesheet
Constants ¶
const DefaultCSRFSecretEnv = "GOWDK_CSRF_SECRET"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BuildConfig ¶
type BuildConfig struct {
Output string
Mode BuildMode
Assets AssetMode
Head HeadConfig
CSRF CSRFConfig
AllowMissingBackend bool
Stylesheets []Stylesheet
Scripts []Script
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.
type BuildMode ¶
type BuildMode string
BuildMode controls whether generated frontend artifacts include development metadata such as source maps. Development is the default when omitted.
type BuildTargetConfig ¶
type BuildTargetConfig struct {
Name string
Modules []string
Output string
App string
Binary string
WASM string
BackendApp string
BackendBinary string
}
BuildTargetConfig declares one configured build target. Modules selects the configured source modules compiled into Output, App, Binary, WASM, BackendApp, and BackendBinary.
type CSRFConfig ¶ added in v0.1.5
type CSRFConfig struct {
Enabled bool
SecretEnv string
CookieName string
FieldName string
HeaderName string
Insecure bool
}
CSRFConfig controls generated action CSRF token wiring.
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 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 ¶
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 Config ¶
type Config struct {
AppName string
Source SourceConfig
Modules []ModuleConfig
Render RenderConfig
Env EnvConfig
Build BuildConfig
CSS CSSConfig
Addons []Addon
}
Config describes how a GOWDK application should be discovered, compiled, and packaged.
func (Config) HasFeature ¶
HasFeature reports whether a config enables a feature through an addon.
type EnvConfig ¶ added in v0.2.7
EnvConfig declares the runtime environment contract for generated apps. It names expected variables and secrets, but never stores secret values.
type EnvValidationError ¶ added in v0.2.7
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
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" FeatureAuth Feature = "auth" FeatureDB Feature = "db" )
type FeatureSet ¶
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
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
HeadConfig controls app-level document head tags emitted around page metadata.
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" // Action emits a non-SSR app shell while allowing backend actions. Action RenderMode = "action" // 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 Script ¶ added in v0.2.1
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
SecretEnv declares a secret environment variable. Secret values intentionally have no config field and must come from the runtime environment.
type SourceConfig ¶
SourceConfig selects portable .gwdk files for discovery.
type SourcePosition ¶ added in v0.1.5
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
|
|
|
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. |
|
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. |
|
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
|
|
|
css
command
|
|
|
login
command
|
|
|
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. |
|
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 emits the tiny client runtime used for partial updates.
|
Package clientrt emits the tiny client runtime used for partial updates. |
|
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. |
|
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. |
|
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. |
|
view
Package view parses and renders the first subset of view {} markup.
|
Package view parses and renders the first subset of view {} markup. |
|
runtime
|
|
|
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. |
|
testfixture
|
|