Skip to main content

Module envtemplate

Module envtemplate 

Source
Expand description

Reading a server’s dotenv template as its configuration surface.

A server that documents its knobs in a .env.template has already written the thing an SDK needs: the names, the defaults, and the prose explaining each one. Parsing that file is what lets an embedded server be configured the same way whether it is deployed or spawned by a pip installed client — one source, two consumers, no second list to keep in step.

The grammar is the dotenv subset every such file already uses: KEY=value lines, # comments above an entry as its documentation, and # KEY=value for a knob deliberately left unset.

Structs§

EnvVar
One environment variable the embedded server reads.

Functions§

markdown_table
Render the knobs as a README table. Same text in both languages: the variables belong to the server, not to whoever is calling it.
parse
Parse a dotenv-style template into the knobs it documents.