Documentation
¶
Index ¶
- Variables
- func ConnectionDomain(name string) string
- func DialectFromConnectionName(name string) (string, bool)
- func GenerateClientViaConsole(root, console, protoDir, lockPath string) error
- func GuideViaConsole(root, console string) error
- func PinFingerprintOf(path string) string
- func ReadDepVersions(root, genDir string) (*codegenpb.DepVersions, error)
- func Run(console string, force bool, adoptGitignore bool, gofmt string) error
Constants ¶
This section is empty.
Variables ¶
var ErrSdkFloor = errors.New("sdk/go pin predates this client")
ErrSdkFloor marks the one failure in resolveSdkGoPins that is a REFUSAL rather than a hiccup, so the caller can stop instead of warning.
It has to be distinguishable, and a consumer proved why: the caller treats every error from that function as non-fatal, because the original ones were proxy outages where the files were already written. So the floor check — shipped as "codegen REFUSES a stale pin", in a release and in two letters — came out as one warning among nine with exit 0, and the tree was left with the stale pin in place. A refusal that does not refuse is worse than no refusal: it is a promise the reader acts on.
Functions ¶
func ConnectionDomain ¶
ConnectionDomain returns the segment before the first `-` in a `<domain>-<role>` connection name (e.g. "forge-postgres" → "forge"). Used for the PG init-dir mount path + the default user/db credentials in the dev compose.
func DialectFromConnectionName ¶
DialectFromConnectionName picks the dialect from the connection-name `<domain>-<dialect>` suffix — the same convention the connection name follows everywhere (the dialect itself is declared in proto's (w17.module).connection, never stored in the lock). Excludes nats / s3, which don't appear in compose.w17.yaml as per-connection services (nats has its own block, s3 is versionless managed infrastructure).
func GenerateClientViaConsole ¶
GenerateClientViaConsole renders the FE client tree(s) on the console's GenerateClient RPC (seam-D, thin-client refactor Step 3a) and writes them under each client's output_root. Uploads the proto tree + the signed lock (the generator reads generated_code.clients[] from it).
func GuideViaConsole ¶
GuideViaConsole fetches the w17 PLATFORM self-description (w17/specs/*) from the console's Guide RPC and writes it under the project root. The content is generated SERVER-SIDE from the compiler's own vocabulary, so it always matches the running compiler — a thin client of any version gets a current description. Takes no project input.
func PinFingerprintOf ¶
PinFingerprintOf exposes the go.mod stamp reader to the verify package, which runs the release gate. Same file read, same "" for a pre-stamp bundle; exported rather than duplicated so the two readers cannot drift on what the stamp looks like.
func ReadDepVersions ¶
func ReadDepVersions(root, genDir string) (*codegenpb.DepVersions, error)
ReadDepVersions exposes the project's own go.mod pins. The release gate sends them so the console can compute the fingerprint a render WOULD produce: a bundle's pin set is a merge of these and the compiler's, and an expectation built from the compiler's alone would refuse every project that pins anything itself.
func Run ¶
Run is the package-level codegen entrypoint (invoked by the cmd/codegen kong command + stack build): it gathers the project's LOCAL inputs (proto tree, signed lock, go.module, go.mod dep-versions, the current gen Go tree, the co-dev env) and streams them to the console's GenerateProject RPC, which now owns ALL codegen orchestration server-side (surface detection, target derivation, composition, per-generator sequencing, file routing, the supersede-sweep — thin-client refactor Step 2). The client applies each streamed op under the project root with no derivation: write / write-if-missing / delete, plus the two LOCAL-disk merges it still owns (generated-go.mod replace preservation; the .po merge moved server-side) and go.work sync.
Types ¶
This section is empty.