endpointsexample

package
v0.12.1 Latest Latest
Warning

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

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

README

Endpoint Examples Cookbook

This cookbook groups broader native endpoint examples in one generated app. The .gwdk files declare endpoint metadata and forms; src/endpoints/handlers.go owns request behavior, validation, redirects, JSON, and fragments in normal Go.

Run from this directory:

make check
make routes
make build
GOWDK_CSRF_SECRET=development-endpoints-csrf-secret-32b GOWDK_ADDR=127.0.0.1:8093 bin/endpoints

Pages

Page Demonstrates
contact.page.gwdk Contact action redirect plus inline validation fragment response.
settings.page.gwdk Settings save/reset actions returning partial fragments.
upload.page.gwdk Multipart action form with generated file policy and typed form.File handler input.
api.page.gwdk Typed generated API handlers for session, search, and JSON CRUD plus a raw request webhook escape hatch.
fragments.page.gwdk Inline validation, table row, list refresh, modal body, and dashboard card fragments.

Endpoint Inventory

  • Actions: Contact, ValidateContact, SaveSettings, ResetSettings, UploadAvatar, RefreshInventory, UpdateInventoryRow, OpenModal, and RefreshDashboardCard.
  • APIs: Session, Search, ListItems, CreateItem, UpdateItem, DeleteItem, and DeployWebhook.
  • Standalone fragments: InlineValidation, InventoryRow, InventoryList, ModalBody, and DashboardCard.

Current Limits

  • Generated typed API handlers own query and JSON-body decoding for supported scalar struct fields. Handlers still own domain validation, authentication, authorization, persistence, and any raw request/header handling.
  • Action generated validation covers direct literal form constraints; domain validation remains in src/endpoints/handlers.go.
  • Multipart action uploads enforce generated request/file limits, but storage, scanning, and persistence remain user-owned Go behavior.
  • Fragment hooks and static fragment bodies are HTML strings today; richer typed fragment render helpers are still planned.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Config = gowdk.Config{
	AppName: "GOWDK Endpoint Cookbook",
	Source: gowdk.SourceConfig{
		Include: []string{"src/**/*.gwdk"},
	},
	Build: gowdk.BuildConfig{
		Output: "examples/endpoints/dist",
		Targets: []gowdk.BuildTargetConfig{
			{
				Name:   "endpoints",
				Output: "examples/endpoints/dist",
				App:    "examples/endpoints/.gowdk/app",
				Binary: "examples/endpoints/bin/endpoints",
			},
		},
	},
	Addons: []gowdk.Addon{
		partial.Addon(),
	},
}

Functions

This section is empty.

Types

This section is empty.

Directories

Path Synopsis
src

Jump to

Keyboard shortcuts

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