DSLs
osapi is built from definitions. You write a definition in Go, and osapi builds the routes, commands, spec, docs and tests from it. There are three DSLs and one set of rules for how behaviors call each other:
| DSL | You define | osapi builds |
|---|---|---|
| Behavior DSL | one thing that osapi manages on a host | its routes, agent dispatch, commands, spec, docs and tests |
| Chains | the behaviors that a behavior calls | nothing new: the rules, and the view of each call |
| Endpoint DSL | a route of the controller, such as the job list | its route, its part of the spec, and its commands |
| Command DSL | a command that runs in the CLI and calls no API | the command, its flags, its help and its page |
Each page here comes from the binary. It lists the same terms that the
spec get command of the DSL prints, such as osapi behavior spec get. Thus a
page always agrees with the build that you run. just cli-docs-generate writes
them, and just test fails when a page does not match the binary.
Building a behavior, Building an endpoint and Building a command tell how to build with each DSL. The Reference shows what this build has.
Behavior DSL
Each part of a behavior definition: what it makes osapi do, and when to use it.
Chains
How a behavior builds on others and calls them on the same host, what occurs
Endpoint DSL
Each part of an endpoint group: a route of the controller, its spec and its
Command DSL
Each part of a local group: a command that runs in the CLI and calls no API.