The app
The app
- Application lifecycle: An Anetos application goes through five phases: New → Register → Boot → Run → Shutdown. Knowing which code runs in which phase tells you where to put configuration, wiring, connections and cleanup.
- Runtime supervisor: Every Anetos application runs its long-lived work (HTTP servers, queue workers, pub/sub listeners, the scheduler, background tasks) as goroutines inside one process, managed by a supervisor. It decides what runs, what happens when something fails, and how everything stops.
- One binary: Your app builds to one binary that is both the server and its maintenance tool.
app.Execute()reads the first argument and runs that command:runby default, orserve,migrate,routes:listand commands of your own. Code generation lives elsewhere, in theanetosdeveloper tool, because it writes source code rather than running the app. - Configuration: Where settings come from, how they become typed Go structs, and why a bad setting stops the app before it serves a single request.
- Code generation: Queries in Anetos name columns with typed Go values, such as
PostCols.Title, thatanetos genwrites from your model structs. The compiler checks every column name and every value’s type, and nothing has to look a column up at query time. - Testing model: What
anetostestbuilds for a test, how it keeps tests from seeing each other’s data, how its client imitates a browser, and where a test run differs from production.