project

package
v0.1.0-alpha.13 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const GeneratedDir = "generated"

GeneratedDir is the website-relative directory owned by gobeyond for projections, registries, contracts, and generated process mains. Authors write app/, workers/, and internal/ only.

Must not start with "." or "_": Go ignores those directory names when matching package patterns, and import paths under them break normal `go build` / `go test` workflows.

View Source
const LegacyGeneratedDir = "internal/gobeyondgen"

LegacyGeneratedDir is the pre-alpha.11 projection root; SyncGoSources removes it.

Variables

This section is empty.

Functions

func APIKey

func APIKey(relative string) string

APIKey returns the deterministic, Go-safe generated package directory for a co-located app/api route. The input is relative to app/api.

func BuildID

func BuildID(root string, routes []Route) (string, error)

func BuildSnapshot

func BuildSnapshot(root string) (map[string]string, error)

BuildSnapshot records the same source files used by BuildID, keyed by their slash-normalized path relative to root. Development mode uses it to identify which build products a source edit can affect.

func Generate

func Generate(root, buildRoot string, check bool) error

func SyncGoSources

func SyncGoSources(root string, routes []Route, check bool) error

SyncGoSources projects route-owned Go into import-safe generated packages. Authored app directories remain editor inputs and are never imported by the production server.

func WorkerKey

func WorkerKey(workerID string) string

WorkerKey returns the deterministic Go-safe package directory for a worker id.

func Write

func Write(root string, routes []Route, buildID string, check bool) error

Write persists deterministic route registries using an already finalized build identity. The build command uses this after hashing compiler outputs.

Types

type Manifest

type Manifest struct {
	APIVersion string  `json:"apiVersion"`
	BuildID    string  `json:"buildId"`
	Routes     []Route `json:"routes"`
}

func LoadManifest

func LoadManifest(root string) (Manifest, error)

type Route

type Route struct {
	ID          string `json:"id"`
	Pattern     string `json:"pattern"`
	Mode        string `json:"mode"`
	Reason      string `json:"reason"`
	AppDir      string `json:"appDir"`
	ServerKey   string `json:"serverKey"`
	PageFile    string `json:"pageFile"`
	SchemaFile  string `json:"schemaFile,omitempty"`
	BuildFile   string `json:"buildFile,omitempty"`
	ServerFile  string `json:"serverFile,omitempty"`
	PlanFile    string `json:"planFile"`
	ClientEntry string `json:"clientEntry"`
}

func Discover

func Discover(root string) ([]Route, error)

type Worker

type Worker struct {
	// ID is the queue leaf (folder name or "default").
	ID string
	// Key is the Go-safe generated package directory name.
	Key string
	// DurablesFile is slash-separated relative to the website root.
	DurablesFile string
}

Worker describes one authored durables unit under workers/.

func DiscoverWorkers

func DiscoverWorkers(root string) ([]Worker, error)

DiscoverWorkers finds workers/**/durables.go. Allowed layouts:

  • workers/durables.go → id "default"
  • workers/<name>/durables.go → id <name>

Nested durables deeper than one folder under workers/ are rejected.

Jump to

Keyboard shortcuts

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