Documentation
¶
Index ¶
- Constants
- func APIKey(relative string) string
- func BuildID(root string, routes []Route) (string, error)
- func BuildSnapshot(root string) (map[string]string, error)
- func Generate(root, buildRoot string, check bool) error
- func SyncGoSources(root string, routes []Route, check bool) error
- func WorkerKey(workerID string) string
- func Write(root string, routes []Route, buildID string, check bool) error
- type Manifest
- type Route
- type Worker
Constants ¶
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.
const LegacyGeneratedDir = "internal/gobeyondgen"
LegacyGeneratedDir is the pre-alpha.11 projection root; SyncGoSources removes it.
Variables ¶
This section is empty.
Functions ¶
func APIKey ¶
APIKey returns the deterministic, Go-safe generated package directory for a co-located app/api route. The input is relative to app/api.
func BuildSnapshot ¶
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 SyncGoSources ¶
SyncGoSources projects route-owned Go into import-safe generated packages. Authored app directories remain editor inputs and are never imported by the production server.
Types ¶
type Manifest ¶
type Manifest struct {
APIVersion string `json:"apiVersion"`
BuildID string `json:"buildId"`
Routes []Route `json:"routes"`
}
func LoadManifest ¶
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"`
}
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 ¶
DiscoverWorkers finds workers/<id>/durables.go. Allowed layout:
- workers/<name>/durables.go → id <name> (use workers/default/ for the default worker)
Root workers/durables.go is rejected. Nested durables deeper than one folder under workers/ are also rejected.