coreapp

package
v0.0.0-...-b140ed9 Latest Latest
Warning

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

Go to latest
Published: May 11, 2026 License: MIT Imports: 34 Imported by: 0

Documentation

Overview

Package coreapp provides the application entry point for go-core.

It lives in internal/ rather than the root package because the root package exports types (CacheStore, Config, etc.) that internal packages import. Placing the wiring here avoids circular dependencies.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	// contains filtered or unexported fields
}

App holds the initialized services and handlers for the go-core module. Create via New() or NewWithDB().

func New

func New(cfg core.Config) (*App, error)

New creates a new App by connecting to the database (pgx) and initializing all services and handlers.

func NewWithDB

func NewWithDB(cfg core.Config, pool *pgxpool.Pool) (*App, error)

NewWithDB creates a new App using an externally managed DB pool. The caller is responsible for closing the pool.

func (*App) Close

func (a *App) Close()

Close performs graceful shutdown of all background services and, if the pool was created by New(), closes the database connection pool.

func (*App) RegisterRoutes

func (a *App) RegisterRoutes(r *gin.Engine)

RegisterRoutes sets up the Gin template renderer, global middleware, and all route groups on the provided engine. This is a direct transplant of cmd/api/main.go lines ~478-1098.

Jump to

Keyboard shortcuts

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