Documentation
¶
Index ¶
- Constants
- func ValidateAddons(addons []Addon) error
- func ValidateExtensions(extensions []Extension) error
- type Addon
- type AddonCapabilities
- type AddonCapabilityProvider
- type AssetMode
- type AuthFeatureConfig
- type AuthProviderRegistration
- type AuthSessionOptions
- type AuthSessionProvider
- type BodyLimitsConfig
- type BuildConfig
- type BuildMode
- type BuildParams
- type BuildTargetConfig
- type CORSConfig
- type CSRFConfig
- type CSSAsset
- type CSSConfig
- type CSSContext
- type CSSOutputConfig
- type CSSProcessor
- type CSSProcessorContext
- type CSSResult
- type CSSSource
- type Config
- type ContractCronConfig
- type ContractCronJobConfig
- type ContractWorkerConfig
- type EnvConfig
- type EnvValidationError
- type EnvValidationErrors
- type EnvVar
- type Extension
- type ExtensionCapabilityDescriptor
- type ExtensionCapabilityProvider
- type ExtensionDescriptor
- type ExtensionPhase
- type Feature
- type FeatureConfig
- type FeatureSet
- type GoBlockConsumer
- type GoBlockConsumerContext
- type GoBlockContext
- type GoBlockDiagnostic
- type GoBlockFile
- type GoBlockTarget
- type GoHookRef
- type GuardRegistration
- type HeadConfig
- type I18NConfig
- func (config I18NConfig) DefaultLocaleCode() string
- func (config I18NConfig) Enabled() bool
- func (config I18NConfig) LocaleCodes() []string
- func (config I18NConfig) LocalizeRoute(route string, locale string) string
- func (config I18NConfig) LocalizedRoutes(route string) []LocalizedRoute
- func (config I18NConfig) PathPrefix(locale string) string
- func (config I18NConfig) Validate() error
- type InteropConfig
- type LifecycleConfig
- type LoadRegistration
- type LocaleConfig
- type LocalizedRoute
- type ModuleConfig
- type RenderConfig
- type RenderMode
- type SEODynamicSitemap
- type SEOFeatureConfig
- type SEOOptions
- type SEOProvider
- type SEOURL
- type Script
- type SecretEnv
- type SecurityHeadersConfig
- type ServiceRef
- type SourceConfig
- type SourcePosition
- type SourceSpan
- type Stylesheet
Constants ¶
const ( ExtensionCapabilityCSSProcessor = "gowdk.css-processor" ExtensionCapabilityGoBlockConsumer = "gowdk.go-block-consumer" ExtensionCapabilitySEOProvider = "gowdk.seo-provider" ExtensionCapabilityAuthSession = "gowdk.auth-session-provider" )
const DefaultCSRFSecretEnv = "GOWDK_CSRF_SECRET"
const DefaultRequestBodyLimitBytes int64 = 1 << 20
DefaultRequestBodyLimitBytes is the default generated request body cap for action and API endpoints.
const ExtensionProtocolVersion = 1
ExtensionProtocolVersion is the executable build-time extension contract supported by this GOWDK release.
Variables ¶
This section is empty.
Functions ¶
func ValidateAddons ¶ added in v0.12.1
ValidateAddons checks addon identity and feature ownership before compiler planning so invalid declarations fail as config errors instead of panicking during feature lookup or addon execution.
func ValidateExtensions ¶ added in v0.13.0
ValidateExtensions checks protocol, identity, phases, and capability descriptors without executing extension operations.
Types ¶
type Addon ¶
Addon is a config declaration for a named feature set. Some addons also implement build-time extension interfaces such as CSSProcessor, SEOProvider, or GoBlockConsumer; request-time services remain wired by generated app hooks or runtime packages.
func NewAddon ¶
NewAddon creates the legacy built-in feature marker. New configuration should prefer Config.Features; the constructor remains trusted for 0.x compatibility.
func NewBuiltinAddon ¶ added in v0.13.0
NewBuiltinAddon creates the deprecated constructor adapter used by bundled feature packages. The concrete marker is sealed so ordinary custom Addon implementations cannot claim compiler-owned features without implementing a matching executable capability.
type AddonCapabilities ¶ added in v0.13.0
type AddonCapabilities struct {
CSSProcessor CSSProcessor
SEOProvider SEOProvider
AuthSessionProvider AuthSessionProvider
GoBlockConsumer GoBlockConsumer
}
AddonCapabilities describes the optional compiler and generated-output capabilities exposed by an addon. Executable config bridges use this descriptor because Go interface method sets cannot be reconstructed dynamically from data.
func ResolveAddonCapabilities ¶ added in v0.13.0
func ResolveAddonCapabilities(addon Addon) AddonCapabilities
ResolveAddonCapabilities returns explicit addon capabilities when available, otherwise it derives them from the optional interfaces implemented directly by the addon.
func ResolveExtensionCapabilities ¶ added in v0.13.0
func ResolveExtensionCapabilities(extension Extension) AddonCapabilities
ResolveExtensionCapabilities returns the explicit capabilities of an executable extension.
type AddonCapabilityProvider ¶ added in v0.13.0
type AddonCapabilityProvider interface {
AddonCapabilities() AddonCapabilities
}
AddonCapabilityProvider exposes explicit optional addon capabilities. Ordinary in-process addons can keep implementing the optional interfaces directly; bridges and adapters should implement this descriptor instead.
type AuthFeatureConfig ¶ added in v0.13.0
type AuthFeatureConfig struct {
Enabled bool
Session AuthSessionOptions
}
AuthFeatureConfig owns built-in auth feature selection and its typed session configuration.
type AuthProviderRegistration ¶ added in v0.13.0
type AuthProviderRegistration struct {
Hook GoHookRef
// contains filtered or unexported fields
}
AuthProviderRegistration binds native RBAC guards to an auth provider factory.
func RegisterAuthProvider ¶ added in v0.13.0
func RegisterAuthProvider(provider func() gowdkauth.Provider) AuthProviderRegistration
RegisterAuthProvider explicitly binds native RBAC to a typed provider factory.
func (AuthProviderRegistration) Configured ¶ added in v0.13.0
func (registration AuthProviderRegistration) Configured() bool
Configured reports whether an auth provider was explicitly registered.
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
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.
func (BuildConfig) Validate ¶ added in v0.13.0
func (config BuildConfig) Validate() error
Validate rejects build fields that would otherwise be ignored or normalized differently by separate command paths.
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 independently publishable artifact set.
type CORSConfig ¶ added in v0.8.0
type CORSConfig struct {
Enabled bool
AllowedOrigins []string
AllowedMethods []string
AllowedHeaders []string
ExposedHeaders []string
AllowCredentials bool
MaxAgeSeconds int
}
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 {
Disabled bool
SecretEnv string
VerificationSecretEnvs []string
CookieName string
FieldName string
HeaderName string
Insecure bool
}
CSRFConfig is enabled by default. Disabled is its single explicit opt-out.
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 single explicit opt-out.
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.
func (CSRFConfig) SecretEnvNames ¶ added in v0.13.0
func (config CSRFConfig) SecretEnvNames() []string
SecretEnvNames returns the primary CSRF secret environment variable followed by every verification-only secret environment variable.
func (CSRFConfig) Validate ¶ added in v0.13.0
func (config CSRFConfig) Validate() error
Validate checks the structural CSRF configuration without reading secret values from the runtime environment.
func (CSRFConfig) VerificationSecretEnvNames ¶ added in v0.13.0
func (config CSRFConfig) VerificationSecretEnvNames() []string
VerificationSecretEnvNames returns the runtime environment variables whose secrets validate existing CSRF tokens without signing new tokens.
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 {
ProjectRoot string
ConfigDir string
SourceRoot string
WorkingDir string
Sources []CSSSource
OutputDir string
Build BuildConfig
CSS CSSConfig
}
CSSContext is passed to compile-time CSS processors.
type CSSOutputConfig ¶
type CSSProcessor ¶
type CSSProcessor interface {
Addon
ProcessCSS(CSSContext) (CSSResult, error)
}
CSSProcessor is implemented by addons that emit CSS at build time.
type CSSProcessorContext ¶ added in v0.13.0
type CSSProcessorContext interface {
CSSProcessor
ProcessCSSContext(context.Context, CSSContext) (CSSResult, error)
}
CSSProcessorContext is the cancellable form used by executable hosts.
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
I18N I18NConfig
Env EnvConfig
Lifecycle LifecycleConfig
Interop InteropConfig
Build BuildConfig
CSS CSSConfig
Features FeatureConfig
Extensions []Extension
// Addons is the deprecated 0.x compatibility lane. New config should use
// Features for built-ins and Extensions for build-time behavior.
Addons []Addon
}
Config is the root application configuration. Each field delegates to a focused config type; ValidateStructural rejects invalid cross-field states.
func (Config) HasFeature ¶
HasFeature reports whether typed or compatibility config selects a feature.
func (Config) ValidateStructural ¶ added in v0.13.0
ValidateStructural rejects invalid configuration states before compiler, generator, or runtime planning begins. It never reads process environment.
type ContractCronConfig ¶ added in v0.12.0
type ContractCronConfig struct {
Jobs []ContractCronJobConfig
}
type ContractCronJobConfig ¶ added in v0.12.0
type ContractWorkerConfig ¶ added in v0.12.0
type ContractWorkerConfig struct {
EventSource ServiceRef
SeenStore ServiceRef
Backoff ServiceRef
}
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 Extension ¶ added in v0.13.0
type Extension interface {
Name() string
Descriptor() ExtensionDescriptor
}
Extension is distinct from built-in feature selection. Optional compiler capabilities are exposed through ExtensionCapabilityProvider.
type ExtensionCapabilityDescriptor ¶ added in v0.13.0
ExtensionCapabilityDescriptor declares one versioned host capability.
type ExtensionCapabilityProvider ¶ added in v0.13.0
type ExtensionCapabilityProvider interface {
ExtensionCapabilities() AddonCapabilities
}
ExtensionCapabilityProvider exposes the executable capabilities of an Extension independently from built-in feature selection.
type ExtensionDescriptor ¶ added in v0.13.0
type ExtensionDescriptor struct {
Name string
ProtocolVersion int
Phases []ExtensionPhase
Capabilities []ExtensionCapabilityDescriptor
}
ExtensionDescriptor identifies a behaviorful build-time extension.
type ExtensionPhase ¶ added in v0.13.0
type ExtensionPhase string
ExtensionPhase names an explicit compiler phase an extension participates in.
const ( ExtensionPhaseValidate ExtensionPhase = "validate" ExtensionPhasePlan ExtensionPhase = "plan" ExtensionPhaseGeneratedGo ExtensionPhase = "generated-go" ExtensionPhaseCSS ExtensionPhase = "css" ExtensionPhaseBuildMetadata ExtensionPhase = "build-metadata" )
type Feature ¶
type Feature string
Feature names a compiler or generator capability selected from Config.Features or the deprecated Config.Addons compatibility lane. A feature flag enables GOWDK-owned behavior; it does not by itself mean the addon object runs request-time application code.
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 FeatureConfig ¶ added in v0.13.0
type FeatureConfig struct {
SPA bool
Actions bool
Partial bool
SSR bool
API bool
Embed bool
CSS bool
RateLimit bool
Contracts bool
Realtime bool
Auth AuthFeatureConfig
DB bool
SEO SEOFeatureConfig
Observability bool
}
FeatureConfig selects built-in compiler behavior through typed config.
type FeatureSet ¶
FeatureSet is a lookup table of enabled compiler/generator capabilities.
func EnabledFeatures ¶
func EnabledFeatures(config Config) FeatureSet
EnabledFeatures returns built-in feature selection plus deprecated addon compatibility markers. Executable extensions cannot claim built-in features.
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 build-time addon extension point for targeted go blocks such as go addon.contracts {}.
type GoBlockConsumerContext ¶ added in v0.13.0
type GoBlockConsumerContext interface {
GoBlockConsumer
ValidateGoBlockContext(context.Context, GoBlockTarget, GoBlockContext) []GoBlockDiagnostic
GeneratedGoContext(context.Context, GoBlockTarget, GoBlockContext) ([]GoBlockFile, error)
}
GoBlockConsumerContext is the cancellable form used by executable hosts.
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 GoHookRef ¶ added in v0.13.0
GoHookRef is compiler metadata derived from a typed Go function value. Applications should create refs through the Register* constructors.
type GuardRegistration ¶ added in v0.13.0
type GuardRegistration struct {
Hook GoHookRef
// contains filtered or unexported fields
}
GuardRegistration binds generated route startup to a guard registry provider.
func RegisterGuards ¶ added in v0.13.0
func RegisterGuards(provider func() gowdkguard.Registry) GuardRegistration
RegisterGuards explicitly binds custom guards to a typed registry provider.
func (GuardRegistration) Configured ¶ added in v0.13.0
func (registration GuardRegistration) Configured() bool
Configured reports whether a guard provider was explicitly registered.
type HeadConfig ¶ added in v0.1.5
type I18NConfig ¶ added in v0.8.0
type I18NConfig struct {
Locales []LocaleConfig
DefaultLocale string
OmitDefaultPrefix bool
// Errors localizes stable runtime error codes. Missing entries use each
// error's safe default message.
Errors gowdki18n.ErrorBundle
}
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 InteropConfig ¶ added in v0.13.0
type InteropConfig struct {
Loads []LoadRegistration
Guards GuardRegistration
AuthProvider AuthProviderRegistration
}
InteropConfig explicitly connects generated runtime integration points to ordinary application Go packages. Registration constructors accept real Go functions so rename and find-references tooling can follow each binding.
func (InteropConfig) LoadForPage ¶ added in v0.13.0
func (config InteropConfig) LoadForPage(page string) (LoadRegistration, bool)
LoadForPage returns the explicit request-time load binding for page, if any.
func (InteropConfig) Validate ¶ added in v0.13.0
func (config InteropConfig) Validate() error
Validate rejects incomplete, duplicate, and constructor-invalid bindings.
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 LoadRegistration ¶ added in v0.13.0
type LoadRegistration struct {
Page string
Hook GoHookRef
// contains filtered or unexported fields
}
LoadRegistration binds one page ID to its request-time load function.
func RegisterLoad ¶ added in v0.13.0
func RegisterLoad(page string, load any) LoadRegistration
RegisterLoad explicitly binds a page server block to an exported Go load function. The compiler validates the supported ssr.LoadContext signature.
type LocaleConfig ¶ added in v0.8.0
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
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.
type RenderConfig ¶
type RenderConfig struct {
Default RenderMode
}
RenderConfig controls default render behavior. SPA is the default.
func (RenderConfig) DefaultMode ¶
func (config RenderConfig) DefaultMode() RenderMode
DefaultMode returns SPA when no explicit default render mode is set.
func (RenderConfig) Validate ¶ added in v0.13.0
func (config RenderConfig) Validate() error
Validate checks the configured default rendering lane.
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
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 SEOFeatureConfig ¶ added in v0.13.0
type SEOFeatureConfig struct {
Enabled bool
Options SEOOptions
}
SEOFeatureConfig owns built-in SEO feature selection and options.
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
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 ServiceRef ¶ added in v0.7.0
ServiceRef names a package-level provider imported by the generated app. Function must have signature:
func() ([]runtime/app.Service, error)
type SourceConfig ¶
SourceConfig selects portable .gwdk files for discovery.
func (SourceConfig) Validate ¶ added in v0.13.0
func (config SourceConfig) Validate(path string) error
Validate checks source include/exclude entries for silent empty values.
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.
Source Files
¶
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. |
|
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. |
|
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
|
|
|
components/wasm/browser/counter
command
|
|
|
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. |
|
Package helperruntime runs project-scoped gowdk commands inside a generated helper that imports the user's config package.
|
Package helperruntime runs project-scoped gowdk commands inside a generated helper that imports the user's config package. |
|
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. |
|
projectcompile
Package projectcompile owns the shared parse-independent project compiler pipeline used by the CLI, dev server, language tools, and future embedders.
|
Package projectcompile owns the shared parse-independent project compiler pipeline used by the CLI, dev server, language tools, and future embedders. |
|
publish
Package publish stages and commits generated artifact generations.
|
Package publish stages and commits generated artifact generations. |
|
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. |
|
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. |
|
corsorigin
Package corsorigin validates and canonicalizes CORS origin strings.
|
Package corsorigin validates and canonicalizes CORS origin strings. |
|
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. |
|
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
|
|