Expand description
The dsvc CLI for Distributed services — both a binary and a library.
It bundles two things in one crate so there is no cross-repo coordination:
- Pure generation (the [
generate]/[atlas] modules): the rules for a Distributed service project — Cargo layout, Rust source templates, manifest wiring, GitOps/Knative inference, GitHub workflows, and Atlas schema resources. These perform no I/O —generate_service_scaffoldtakes aServiceScaffoldSpecand returns aGeneratedProject;render_atlas_schemawraps desired-state SQL into anAtlasSchema. - The command surface (the [
cli] module): the clap types andrundispatcher that own the filesystem / process side effects (writing files, runninggh, compiling the manifest harness).
The dsvc binary parses ServiceArgs and calls run. Another CLI (e.g.
hops) can depend on this crate, mount ServiceArgs under its own
subcommand, and dispatch with run — re-exporting the commands rather than
reimplementing them.
Structs§
- Atlas
Schema Spec - Input for
render_atlas_schema. Plain data — the caller maps its flags onto this and supplies the desired-state schema SQL. - Describe
Args - Generated
File - A single generated file: a relative path and its contents.
- Generated
Project - The result of generating a scaffold: the files to write, advisory warnings, and side effects for the caller to perform. Filesystem-agnostic.
- Github
Repo - An
owner/repoGitHub identifier. - Scaffold
Args - Scaffold
Error - A scaffold generation error (bad spec value).
- Schema
Args - Service
Args - Service
Scaffold Spec - What to scaffold. The pure input to
generate_service_scaffold.
Enums§
- Atlas
Database Url - How the generated
AtlasSchemareaches its target database URL. - Bus
- BusTarget
- Message bus backend to scaffold.
- File
Mode - File mode hint for a
GeneratedFile. - Framework
- Gitops
Promote - Gitops
Promote Target - GitOps promotion flavor.
- Manifest
Format - Post
Create Action - A side effect the caller should perform after writing the generated files.
- Schema
Dialect - Schema
Format - Service
Commands - Service
Transport - Runtime transport for the scaffolded service.
- Store
- Store
Target - Read-model / schema storage target.
- Transport
Functions§
- generate_
service_ scaffold - Generate a Distributed service project from a spec. The public entry point.
- package_
name - Normalize a free-form service name to its kebab-case package/crate directory
name — the same normalization
generate_service_scaffoldapplies. Callers need this to compute a default output directory before generating. - render_
atlas_ schema - Render an
AtlasSchema(db.atlasgo.io/v1alpha1) resource as YAML. - run
- Dispatch a parsed service command. The
dsvcbinary and any host CLI (e.g.hops service) both call this.