Documentation
¶
Overview ¶
Package application provides application lifecycle management. It handles initialization, configuration, and graceful shutdown of all application components.
Index ¶
- type Application
- func (app *Application) GetCache() *cache.Cache
- func (app *Application) GetConfig() *config.Service
- func (app *Application) GetDatabase() *database.Database
- func (app *Application) GetLogger() *logger.Logger
- func (app *Application) GetServer() *handlers.Server
- func (app *Application) Initialize() error
- func (app *Application) Run() error
- func (app *Application) Shutdown() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Application ¶
type Application struct { Name string Logger *logger.Logger Server *handlers.Server Config *config.Service Database *database.Database Cache *cache.Cache Tracer *tracesdk.TracerProvider ShutdownChan chan os.Signal }
Application represents the main application instance
func NewApplication ¶
func NewApplication() *Application
NewApplication creates a new application instance
func (*Application) GetCache ¶
func (app *Application) GetCache() *cache.Cache
GetCache returns the cache instance
func (*Application) GetConfig ¶
func (app *Application) GetConfig() *config.Service
GetConfig returns the application configuration
func (*Application) GetDatabase ¶
func (app *Application) GetDatabase() *database.Database
GetDatabase returns the database instance
func (*Application) GetLogger ¶
func (app *Application) GetLogger() *logger.Logger
GetLogger returns the application logger
func (*Application) GetServer ¶
func (app *Application) GetServer() *handlers.Server
GetServer returns the HTTP server instance
func (*Application) Initialize ¶
func (app *Application) Initialize() error
Initialize sets up all application components
func (*Application) Run ¶
func (app *Application) Run() error
Run starts the application and handles graceful shutdown
func (*Application) Shutdown ¶
func (app *Application) Shutdown() error
Shutdown gracefully shuts down all application components