Documentation
¶
Overview ¶
Package garm embeds the contract this repository publishes.
The annotations are vendored into a consumer's tree by `garm init` rather than fetched from a registry. That is deliberate: a registry is one more thing an enterprise build has to be allowed to reach, and the annotations are small, stable, and worth reading by the people writing tool schemas against them.
The bytes here are the same bytes `garm init` writes, verbatim and with no added header, so a later drift check is a byte comparison rather than a parse.
Index ¶
Constants ¶
const AnnotationSchemaVersion = 1
AnnotationSchemaVersion is the version of the garm.tool.v1 vocabulary this build speaks, stamped into every catalogue it produces.
A daemon reads the current version and the two previous and refuses anything outside that window at boot. It is an integer rather than a semver because the only question asked of it is "can this binary read that catalogue", and a range check wants a number.
Bump it when a change to the annotations means an older daemon would misread a declaration — not when a field is added that an older daemon can safely ignore.
const VendoredAnnotationsPath = "third_party/proto/garm/tool/v1/tool.proto"
VendoredAnnotationsPath is where AnnotationsProto belongs in a consumer's tree.
Under third_party rather than beside your own protos, and that is not cosmetic: every module in a buf v2 workspace is an input, so annotations living under proto/ get Go generated for them — output that is never usable, because the real one is in this module's contracts package and two packages registering one proto file panic at init.
The tail of the path is part of the contract: an import of "garm/tool/v1/tool.proto" has to resolve, so only the root is a choice.
Variables ¶
var AnnotationsProto []byte
AnnotationsProto is proto/garm/tool/v1/tool.proto, exactly as published.
Functions ¶
This section is empty.
Types ¶
This section is empty.
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
garm
command
Command garm is the garm command line tool: it scaffolds a proto tree, compiles governed tool declarations, and refuses the bad ones.
|
Command garm is the garm command line tool: it scaffolds a proto tree, compiles governed tool declarations, and refuses the bad ones. |
|
protoc-gen-garm-go
command
Command protoc-gen-garm-go is the garm tool generator for Go, in the shape protoc and buf expect to find it: a standalone binary named protoc-gen-<name>, discoverable on PATH.
|
Command protoc-gen-garm-go is the garm tool generator for Go, in the shape protoc and buf expect to find it: a standalone binary named protoc-gen-<name>, discoverable on PATH. |
|
Package contracts is the root of garm's generated tool contracts.
|
Package contracts is the root of garm's generated tool contracts. |
|
callctx
Package callctx encodes the InvocationContext for the NATS hop.
|
Package callctx encodes the InvocationContext for the NATS hop. |
|
wire
Package wire is how a route becomes a NATS address.
|
Package wire is how a route becomes a NATS address. |
|
internal
|
|
|
cli
Package cli holds the cobra conventions every garm binary shares.
|
Package cli holds the cobra conventions every garm binary shares. |
|
compile
Package compile turns proto source into descriptors, in process.
|
Package compile turns proto source into descriptors, in process. |
|
compiler
Package toolgen reads garm tool annotations off descriptors and validates them.
|
Package toolgen reads garm tool annotations off descriptors and validates them. |
|
plugin
Package plugin is the protoc plugin that emits garm tool bindings and fails the build on any error-level lint diagnostic.
|
Package plugin is the protoc plugin that emits garm tool bindings and fails the build on any error-level lint diagnostic. |
|
Package toolpolicy resolves what a principal may see, from annotations on the schema.
|
Package toolpolicy resolves what a principal may see, from annotations on the schema. |
|
redact
Package redact turns a denied field value into what the caller may see.
|
Package redact turns a denied field value into what the caller may see. |