Documentation
¶
Index ¶
- Constants
- type API
- type Action
- type BlockSpans
- type Blocks
- type Component
- type Emit
- type EmitParam
- type Fragment
- type GoFuncRef
- type GoTypeRef
- type Import
- type Layout
- type Manifest
- type NamedSpan
- type Page
- type PageSpans
- type Prop
- type SourcePosition
- type SourceSpan
- type StateContract
- type Store
- type WASMContract
Constants ¶
const PublicSchemaVersion = 1
PublicSchemaVersion is the current gowdk manifest JSON schema version.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct {
Name string
Method string
Route string
Span SourceSpan
RouteSpan SourceSpan
RouteParams []NamedSpan
}
API describes an api block.
type Action ¶
type Action struct {
Name string
Body string
InputName string
InputType string
ValidatesInput bool
Redirect string
Fragments []Fragment
Span SourceSpan
InputSpan SourceSpan
ValidationSpan SourceSpan
RedirectSpan SourceSpan
}
Action describes an act block.
type BlockSpans ¶
type BlockSpans struct {
Paths SourceSpan
Build SourceSpan
Load SourceSpan
Client SourceSpan
View SourceSpan
Actions []NamedSpan
APIs []NamedSpan
Emits SourceSpan
}
BlockSpans records source ranges for page, component, or layout blocks.
type Blocks ¶
type Blocks struct {
PathsBody string
Build bool
BuildBody string
Load bool
LoadBody string
Client bool
ClientBody string
View bool
ViewBody string
Actions []Action
APIs []API
Spans BlockSpans
}
Blocks records the source blocks declared by a page.
type Component ¶
type Component struct {
Source string
Name string
Imports []Import
Props []Prop
PropsType GoTypeRef
State StateContract
WASM WASMContract
Emits []Emit
Blocks Blocks
Span SourceSpan
}
Component describes a .cmp.gwdk component after parsing and normalization.
type Emit ¶
type Emit struct {
Name string
Params []EmitParam
Span SourceSpan
}
Emit describes one component event emitted by a browser island.
type EmitParam ¶
type EmitParam struct {
Name string
Type string
Span SourceSpan
}
EmitParam describes one scalar field in a component event payload.
type Fragment ¶
type Fragment struct {
Target string
Body string
Span SourceSpan
}
Fragment describes a server fragment declared inside an action.
type GoFuncRef ¶
type GoFuncRef struct {
Alias string
Name string
Span SourceSpan
}
GoFuncRef references a Go function through an import alias declared in a .gwdk source file.
type GoTypeRef ¶
type GoTypeRef struct {
Alias string
Name string
Span SourceSpan
}
GoTypeRef references a Go type through an import alias declared in a .gwdk source file.
type Import ¶
type Import struct {
Alias string
Path string
Span SourceSpan
}
Import records a Go import declared by a .gwdk page.
type Layout ¶
type Layout struct {
Source string
ID string
Blocks Blocks
Span SourceSpan
}
Layout describes a .layout.gwdk layout after parsing and normalization.
type Manifest ¶
Manifest is the compiler's normalized view of discovered .gwdk files.
func (Manifest) MarshalJSON ¶
MarshalJSON emits the route manifest shape consumed by generated binaries.
type NamedSpan ¶
type NamedSpan struct {
Name string
Span SourceSpan
}
NamedSpan records the source range for a named declaration or reference.
type Page ¶
type Page struct {
Source string
ID string
Route string
Render gowdk.RenderMode
Layouts []string
Guard []string
CSS []string
Imports []Import
Stores []Store
Paths bool
Blocks Blocks
Spans PageSpans
}
Page describes a .gwdk page after parsing and normalization.
func (Page) DynamicParams ¶
DynamicParams returns route parameters declared with /path/{param} syntax.
func (Page) RenderMode ¶
func (page Page) RenderMode(defaultMode gowdk.RenderMode) gowdk.RenderMode
RenderMode returns the effective render mode for a page.
type PageSpans ¶
type PageSpans struct {
Page SourceSpan
Route SourceSpan
Render SourceSpan
Layouts []NamedSpan
Guard []NamedSpan
CSS []NamedSpan
RouteParams []NamedSpan
}
PageSpans records source ranges for page annotations and declarations.
type Prop ¶
type Prop struct {
Name string
Type string
Span SourceSpan
}
Prop describes one component prop declaration.
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.
type StateContract ¶
type StateContract struct {
Type GoTypeRef
Init GoFuncRef
Span SourceSpan
}
StateContract describes a local component state type and build-time initializer.
type Store ¶
type Store struct {
Name string
Type GoTypeRef
Init GoFuncRef
Span SourceSpan
}
Store describes one page-scoped shared state declaration.
type WASMContract ¶
type WASMContract struct {
Package string
Span SourceSpan
}
WASMContract points an explicit browser-side Go package at a component.