setup

package
v0.0.0-...-eefbc77 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2025 License: GPL-2.0 Imports: 20 Imported by: 0

Documentation

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     // Application configuration
	Logger       *zap.Logger        // Main application logger
	DBLogger     *zap.Logger        // Database-specific logger
	DB           database.Client    // Database connection pool
	AIClient     *aiClient.AIClient // AI client providers
	RoAPI        *api.API           // RoAPI HTTP client
	RedisManager *redis.Manager     // Redis connection manager
	StatusClient rueidis.Client     // Redis client for worker status reporting
	CFClient     *cloudflare.Client // Cloudflare D1 client for cloudflare operations
	LogManager   *telemetry.Manager // Log management system

	Middlewares *client.Middlewares // HTTP client middleware instances
	// contains filtered or unexported fields
}

App bundles all core dependencies and services needed by the application. Each field represents a major subsystem that needs initialization and cleanup.

func InitializeApp

func InitializeApp(ctx context.Context, serviceType telemetry.ServiceType, logDir string, workerInfo ...string) (*App, error)

InitializeApp bootstraps all application dependencies.

func (*App) Cleanup

func (s *App) Cleanup(ctx context.Context)

Cleanup ensures graceful shutdown of all components in reverse initialization order. Logs but does not fail on cleanup errors to ensure all components get cleanup attempts.

Jump to

Keyboard shortcuts

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