[#1267] call app.Bootstrap() before cobra commands execution

This commit is contained in:
Gani Georgiev
2022-12-15 23:20:23 +02:00
parent 8e582acbee
commit c25e67e13d
6 changed files with 189 additions and 20 deletions
+7 -1
View File
@@ -78,8 +78,14 @@ type App interface {
// RefreshSettings reinitializes and reloads the stored application settings.
RefreshSettings() error
// IsBootstrapped checks if the application was initialized
// (aka. whether Bootstrap() was called).
IsBootstrapped() bool
// Bootstrap takes care for initializing the application
// (open db connections, load settings, etc.)
// (open db connections, load settings, etc.).
//
// It will call ResetBootstrapState() if the application was already bootstrapped.
Bootstrap() error
// ResetBootstrapState takes care for releasing initialized app resources