Skip to main content
Version: v0.2.2

Application lifecycle

A Colibri application starts its base components first, optional modules next, and the blocking process last.

func main() {
colibri.InitializeApp()

sqlDB.Initialize()
cacheDB.Initialize()

restserver.AddRoutes(routes)
restserver.ListenAndServe()
}

InitializeApp() loads configuration, prepares logging and validation, registers signal handling, initializes monitoring, and configures the cloud provider.

SQL, cache, messaging, and storage are optional. Initialize only the modules the application uses.

warning

Optional module operations depend on their corresponding Initialize() call.

SDK components register their own shutdown observers. Application resources can implement observer.Observer and be registered with observer.Attach.