bootstrap

package
v1.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 21, 2024 License: MIT Imports: 28 Imported by: 0

Documentation

Overview

Package bootstrap provides functionality to initialize and start the application. It handles the setup of various components such as logging, databases, caching, message queues, and HTTP servers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	Config        *config.Config
	Logger        *logger.Manager
	Redis         map[string]*redis.Manager
	I18n          *i18n.Manager
	MysqlDB       map[string]*gorm.DB
	MongoDB       map[string]*qmgo.Database
	Middleware    middleware.Middleware
	KafkaProducer *kafka.Manager
	KafkaConsumer *kafka.Manager
	Mux           *gin.Engine
	Notify        *notify.Manager
	TraceID       *trace.ID
}

App represents the main application structure, containing all necessary components and configurations.

func NewApp

func NewApp(config *config.Config) (*App, error)

NewApp creates and initializes a new App instance.

Parameters:

  • config: A pointer to the application configuration.

Returns:

  • *App: A pointer to the initialized App instance.
  • error: An error if any initialization step fails.

func (*App) Start

func (a *App) Start()

Start initiates the application by starting the HTTP server, Kafka consumer, and scheduled tasks. It runs each component in a separate goroutine.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL