Behavior for Gno.Service.Setup extensions with custom setup logic.
Summary
Callbacks
Checks if the service's repository is set up, i.e. exists.
Performs extension-specific initialization during setup.
Performs extension-specific teardown.
Validates the setup state after all initialization is complete.
Functions
Provides default implementations of the setup extension callbacks.
Callbacks
@callback check_setup( Gno.Service.t(), keyword() ) :: :ok | {:error, term()}
Checks if the service's repository is set up, i.e. exists.
Called during setup to verify if the repository already exists and is accessible.
Implementations should implement a minimal check to verify the repository exists.
More detailed validation should be done in the validate/2 callback.
@callback setup( Gno.Service.t(), keyword() ) :: {:ok, Gno.Service.t()} | {:error, term()}
Performs extension-specific initialization during setup.
Called after the repository has been initialized but before validation. The extension can perform any additional setup steps needed, such as:
- Creating application-specific graphs
- Setting up initial data structures
- Configuring external systems
Returns the service (potentially modified) on success.
@callback teardown( Gno.Service.t(), keyword() ) :: :ok | {:error, term()}
Performs extension-specific teardown.
@callback validate( Gno.Service.t(), keyword() ) :: :ok | {:error, term()}
Validates the setup state after all initialization is complete.
Called as the final step of setup to ensure everything is properly configured. Should check that all required components are in place and properly initialized.