app

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2026 License: MIT Imports: 26 Imported by: 0

README

internal/app

Composition root for dependency injection.

Pattern used

  • Manual DI via constructor wiring (no service locator).
  • Build in stages: infra stores -> repositories -> usecases -> handlers -> server.
  • Return startup errors early and clean up already-initialized resources.
  • Keep provider-specific adapter assembly in wiring helpers (for example Redis store bundle).

How to extend

  • Add constructor wiring in wiring.go only.
  • Keep business logic out of this package.
  • Keep initialization deterministic and testable.

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
	Logger        logger.Logger
	DBPool        *pgxpool.Pool
	RedisClient   *goredis.Client
	Server        *httpDelivery.Server
	Observability observability.Runtime
}

func New

func New(ctx context.Context) (*App, error)

func (*App) Shutdown

func (a *App) Shutdown(ctx context.Context) error

func (*App) Start

func (a *App) Start() error

Jump to

Keyboard shortcuts

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