Skip to main content

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:

DSLYou defineosapi builds
Behavior DSLone thing that osapi manages on a hostits routes, agent dispatch, commands, spec, docs and tests
Chainsthe behaviors that a behavior callsnothing new: the rules, and the view of each call
Endpoint DSLa route of the controller, such as the job listits route, its part of the spec, and its commands
Command DSLa command that runs in the CLI and calls no APIthe 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.