borgmatic/docs/reference/source-code.md
Dan Helfman 2a1c790655
Some checks are pending
build / test (push) Waiting to run
build / docs (push) Blocked by required conditions
Minor reorganization of borgmatic source code reference.
2024-06-26 19:39:32 -07:00

2.3 KiB

title eleventyNavigation
Source code reference
key parent order
🐍 Source code reference Reference guides 3

getting oriented

If case you're interested in developing on borgmatic, here's an abridged primer on how its Python source code is organized to help you get started. Starting at the top level, we have:

  • borgmatic: The main borgmatic source module. Most of the code is here. Within that:
    • actions: borgmatic-specific logic for running each action (create, list, check, etc.).
    • borg: Lower-level code that's responsible for interacting with Borg to run each action.
    • commands: Looking to add a new flag or action? Start here. This contains borgmatic's entry point, argument parsing, and shell completion.
    • config: Code responsible for loading, normalizing, and validating borgmatic's configuration.
    • hooks: Looking to add a new database or monitoring integration? Start here.
  • docs: How-to and reference documentation, including the document you're reading now.
  • sample: Example configurations for cron and systemd.
  • scripts: Dev-facing scripts for things like building documentation and running end-to-end tests.
  • tests: Automated tests organized by: end-to-end, integration, and unit.

So, broadly speaking, the control flow goes: commandsconfig followed by commandsactionsborg and hooks.