Documentation
¶
Overview ¶
Package source holds the neutral leaf value types shared across the GOWDK compiler packages: source spans, route params, inline scripts, and backend binding metadata. These types carry no behavior and depend on nothing else in the module, so every layer (parser, AST, IR, manifest, generated output) can reference them without creating import cycles or coupling to the manifest page/component model.
Historically these lived in internal/manifest, which forced packages that only needed a SourceSpan to depend on the whole manifest model (and made internal/gwdkir depend on manifest). They were extracted here so the manifest model and the IR can both reference shared leaf types from a neutral home. manifest re-exports them as aliases for backward compatibility.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrorPagePath ¶
ErrorPagePath returns a clean generated-output-relative error page path.
func InlineScriptName ¶
InlineScriptName returns the deterministic generated filename for the zero-based inline browser script declaration index in one source owner.
Types ¶
type BackendBinding ¶
type BackendBinding struct {
Kind string
PageID string
Source string
BlockName string
Method string
Route string
ImportPath string
PackageName string
FunctionName string
Signature BackendSignatureKind
InputType string
InputPointer bool
InputFields []BackendInputField
Status BackendBindingStatus
Message string
}
BackendBinding describes the Go handler selected for a backend block (a page load, act, api, or fragment block, or a standalone Go endpoint).
type BackendBindingStatus ¶
type BackendBindingStatus string
BackendBindingStatus describes whether a .gwdk backend block has a matching same-package Go handler.
const ( BackendBindingBound BackendBindingStatus = "bound" BackendBindingMissing BackendBindingStatus = "missing" BackendBindingUnsupportedSignature BackendBindingStatus = "unsupported_signature" )
type BackendInputField ¶
BackendInputField describes one form field decoded into a Go action input struct from compile-time Go AST metadata.
type BackendSignatureKind ¶
type BackendSignatureKind string
BackendSignatureKind describes the supported Go handler shape.
const ( BackendSignatureAction0 BackendSignatureKind = "action0" BackendSignatureActionValues BackendSignatureKind = "action_values" BackendSignatureActionForm BackendSignatureKind = "action_form" BackendSignatureActionFormPtr BackendSignatureKind = "action_form_ptr" BackendSignatureAPI BackendSignatureKind = "api" BackendSignatureFragment BackendSignatureKind = "fragment" BackendSignatureLoad BackendSignatureKind = "load" BackendSignatureLoadError BackendSignatureKind = "load_error" )
type InlineScript ¶
type InlineScript struct {
Name string
Body string
Span SourceSpan
}
InlineScript records browser module code declared directly inside a .gwdk source file. Path-based script declarations should remain preferred.
type NamedSpan ¶
type NamedSpan struct {
Name string
Span SourceSpan
}
NamedSpan records the source range for a named declaration or reference.
type RouteParam ¶
type RouteParam struct {
Name string
Type string
Span SourceSpan
}
RouteParam describes one dynamic route parameter and its declared scalar type. Empty Type means string for compatibility with legacy {name} syntax.
type SourcePosition ¶
SourcePosition is a 1-based source location in a parsed .gwdk file.
type SourceSpan ¶
type SourceSpan struct {
Start SourcePosition
End SourcePosition
}
SourceSpan is a 1-based source range. End is exclusive.