codegen

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package codegen emits Go, HTML, CSS, and asset artifacts from a manifest.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateAPIPackage

func GenerateAPIPackage(app manifest.Manifest, options APIPackageOptions) ([]byte, error)

GenerateAPIPackage emits Go HTTP handler stubs for declared api {} blocks. The stubs are deliberate 501 responses until user/application logic is wired.

func GenerateActionPackage

func GenerateActionPackage(config gowdk.Config, app manifest.Manifest, options ActionPackageOptions) ([]byte, error)

GenerateActionPackage emits HTTP handlers for declared act {} blocks.

func GenerateComponentPackage

func GenerateComponentPackage(components []manifest.Component, options ComponentPackageOptions) ([]byte, error)

GenerateComponentPackage emits Go render functions for the current component subset: string props and direct {prop} interpolation inside component views.

func GenerateFragmentPackage

func GenerateFragmentPackage(app manifest.Manifest, options FragmentPackageOptions) ([]byte, error)

GenerateFragmentPackage emits Go render functions for parsed server fragments. Each function returns the runtime fragment response envelope.

func GenerateRouteRegistration

func GenerateRouteRegistration(bindings []RouteBinding, options RouteRegistrationOptions) ([]byte, error)

GenerateRouteRegistration emits Go source that registers route bindings on an http.ServeMux. Handler package aliases used by bindings must be provided in options.Imports so the generated file is complete and formatted.

func GenerateSSRPackage

func GenerateSSRPackage(config gowdk.Config, app manifest.Manifest, options SSRPackageOptions) ([]byte, error)

GenerateSSRPackage emits HTTP handler stubs for pages that are explicitly request-time full-page routes: @render ssr and accepted @render hybrid pages.

Types

type APIPackageOptions

type APIPackageOptions struct {
	PackageName string
}

APIPackageOptions configures generated API handler package source.

type ActionPackageOptions

type ActionPackageOptions struct {
	PackageName string
}

ActionPackageOptions configures generated action handler package source.

type ComponentPackageOptions

type ComponentPackageOptions struct {
	PackageName string
}

ComponentPackageOptions configures generated component package source.

type FragmentPackageOptions

type FragmentPackageOptions struct {
	PackageName string
}

FragmentPackageOptions configures generated server fragment package source.

type RouteBinding

type RouteBinding struct {
	Kind    RouteKind
	Method  string
	Route   string
	PageID  string
	Handler string
}

RouteBinding is the route-level codegen plan used by the generated binary.

func BuildRouteBindings

func BuildRouteBindings(config gowdk.Config, app manifest.Manifest) ([]RouteBinding, error)

BuildRouteBindings converts a validated manifest into generated route behavior. It does not emit Go source yet; it gives codegen a typed plan.

type RouteKind

type RouteKind string

RouteKind describes generated binary route behavior.

const (
	RouteStatic RouteKind = "static"
	RouteAction RouteKind = "action"
	RouteSSR    RouteKind = "ssr"
	RouteAPI    RouteKind = "api"
)

type RouteRegistrationOptions

type RouteRegistrationOptions struct {
	PackageName string
	Imports     map[string]string
}

RouteRegistrationOptions configures generated route registration source.

type SSRPackageOptions

type SSRPackageOptions struct {
	PackageName string
}

SSRPackageOptions configures generated SSR handler package source.

Jump to

Keyboard shortcuts

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