Skip to main content

Crate distributed_cli

Crate distributed_cli 

Source
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_scaffold takes a ServiceScaffoldSpec and returns a GeneratedProject; render_atlas_schema wraps desired-state SQL into an AtlasSchema.
  • The command surface (the [cli] module): the clap types and run dispatcher that own the filesystem / process side effects (writing files, running gh, 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§

AtlasSchemaSpec
Input for render_atlas_schema. Plain data — the caller maps its flags onto this and supplies the desired-state schema SQL.
DescribeArgs
GeneratedFile
A single generated file: a relative path and its contents.
GeneratedProject
The result of generating a scaffold: the files to write, advisory warnings, and side effects for the caller to perform. Filesystem-agnostic.
GithubRepo
An owner/repo GitHub identifier.
ScaffoldArgs
ScaffoldError
A scaffold generation error (bad spec value).
SchemaArgs
ServiceArgs
ServiceScaffoldSpec
What to scaffold. The pure input to generate_service_scaffold.

Enums§

AtlasDatabaseUrl
How the generated AtlasSchema reaches its target database URL.
Bus
BusTarget
Message bus backend to scaffold.
FileMode
File mode hint for a GeneratedFile.
Framework
GitopsPromote
GitopsPromoteTarget
GitOps promotion flavor.
ManifestFormat
PostCreateAction
A side effect the caller should perform after writing the generated files.
SchemaDialect
SchemaFormat
ServiceCommands
ServiceTransport
Runtime transport for the scaffolded service.
Store
StoreTarget
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_scaffold applies. 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 dsvc binary and any host CLI (e.g. hops service) both call this.