Documentation
¶
Overview ¶
Package inspect runs an inspection command of an application and returns the JSON document that it printed.
The routes, the modules and the models of an application live in its own code, so the CLI and the MCP server both ask the application. The application answers before it loads the configuration and before it opens the database. See the SDD, S14 and S16.
Index ¶
Constants ¶
const ( // Routes returns the routes of the application. Routes = "routes" // Modules returns the contribution of each module. Modules = "modules" // OpenAPI returns the description of the API of the application. OpenAPI = "openapi" // Schema returns the models that the modules describe. Schema = "schema" // Doctor proves the configuration, the database and the broker. Doctor = "doctor" // Migrate applies the migrations of every module of the application, or // reports the ones that the database does not hold. The migrations stand // in the binary, so the application applies them. Migrate = "migrate" )
The inspection commands.
const Prefix = "avero:"
Prefix marks a command that the binary sends to the application.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Result ¶
type Result struct {
// Stdout holds the document that the application printed.
Stdout string
// Stderr holds the faults that the application printed.
Stderr string
// Code is the exit code of the application.
Code int
}
Result is the answer of one inspection.
func Run ¶
Run asks the application for one inspection. asJSON returns the document that the schema of the report accepts. args carry the step of a command that states one, such as `avero:migrate up`.
The application reads the environment of this process. RunWithEnv states another environment, which the migration command needs: it reads .env, so a person migrates with no export.