source

package
v0.2.8 Latest Latest
Warning

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

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

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

func ErrorPagePath(value string) (string, error)

ErrorPagePath returns a clean generated-output-relative error page path.

func InlineScriptName

func InlineScriptName(index int) string

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

type BackendInputField struct {
	FieldName string
	FormName  string
	Type      string
}

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

type SourcePosition struct {
	Line   int
	Column int
}

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.

Jump to

Keyboard shortcuts

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