bootstrap

package
v2.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2026 License: MIT Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AdaptModuleJobs

func AdaptModuleJobs(inner jobsmodule.Jobs) core.Jobs

AdaptModuleJobs exposes module jobs behind the app core jobs seam.

func AdaptModuleJobsInspector

func AdaptModuleJobsInspector(inner jobsmodule.JobsInspector) core.JobsInspector

AdaptModuleJobsInspector exposes module job inspector behind the app core seam.

func AdaptNotificationsPubSub

func AdaptNotificationsPubSub(inner core.PubSub) notifications.PubSub

AdaptNotificationsPubSub converts the app pubsub dependency to the notifications module boundary.

func ApplySQLMigrations

func ApplySQLMigrations(db *sql.DB, migrationsDir string, driver string) error

func EnsureEmbeddedSQLiteSchema

func EnsureEmbeddedSQLiteSchema(db *sql.DB) error

EnsureEmbeddedSQLiteSchema creates the minimal schema required by DB-first auth/container paths. Embedded full migration parity is tracked separately in the Bob transition plan.

func IsSQLiteDriver

func IsSQLiteDriver(driver string) bool

func NormalizeSQLiteDriver

func NormalizeSQLiteDriver(driver string) string

func OpenEmbeddedDB

func OpenEmbeddedDB(driver, connection string) (*sql.DB, error)

OpenEmbeddedDB opens an embedded database connection. For SQLite we apply WAL-mode safety pragmas and use a single pooled connection to avoid SQLITE_BUSY lock contention in concurrent app workloads.

func ResolveAdapterPlan

func ResolveAdapterPlan(cfg *config.Config) (adapters.Resolved, error)

ResolveAdapterPlan validates adapter configuration and returns the resolved runtime selection.

func ResolveMigrationsDir

func ResolveMigrationsDir() (string, error)

Types

type Container

type Container struct {
	// Validator stores a validator
	Validator echo.Validator

	// Web stores the web framework
	Web *echo.Echo

	Logger echo.Logger

	// Config stores the application configuration
	Config *config.Config

	// Cache contains the cache client
	Cache *cacherepo.CacheClient

	// Database stores the connection to the database
	Database *sql.DB

	// Mail stores an email sending client
	Mail *mailer.MailClient

	// Auth stores an authentication client
	Auth *authsupport.AuthClient

	// I18n stores localized message resolution for request flows.
	I18n core.I18n

	// EventBus stores the synchronous domain event bus.
	EventBus *events.Bus

	// Notifier handles all notifications to clients
	Notifier *notifications.NotifierService

	// SSEHub stores the in-process SSE fan-out hub.
	SSEHub *sse.Hub

	// CoreCache exposes cache via the backend-agnostic core seam.
	CoreCache core.Cache
	// CoreJobs exposes jobs via the backend-agnostic core seam.
	CoreJobs core.Jobs
	// CoreJobsInspector exposes jobs inspection via the backend-agnostic core seam.
	CoreJobsInspector core.JobsInspector
	// CorePubSub exposes pubsub via the backend-agnostic core seam.
	CorePubSub core.PubSub

	// Health stores the framework-default liveness/readiness registry.
	Health *health.Registry

	// Scheduler stores cron-based app schedule registration.
	Scheduler *cron.Cron

	// Adapters stores resolved adapter selection/capabilities for runtime use.
	Adapters adapters.Resolved
	// contains filtered or unexported fields
}

Container contains all services used by the application and provides an easy way to handle dependency injection including within tests

func NewContainer

func NewContainer(registerSchedules func(*cron.Cron, func() core.Jobs)) *Container

NewContainer creates and initializes a new runtime container.

func (*Container) Shutdown

func (c *Container) Shutdown() error

Shutdown shuts the Container down and disconnects all connections

type JobsProcess

type JobsProcess string
const (
	JobsProcessWeb    JobsProcess = "web"
	JobsProcessWorker JobsProcess = "worker"
)

type JobsRuntime

type JobsRuntime struct {
	Jobs      core.Jobs
	Inspector core.JobsInspector
}

func WireJobsRuntime

func WireJobsRuntime(cfg *config.Config, db *sql.DB, process JobsProcess) (JobsRuntime, error)

WireJobsRuntime creates runtime jobs + inspector bridges from adapter config.

Jump to

Keyboard shortcuts

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