Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func MigrateDB ¶
func MigrateDB( logger *zap.Logger, dbDSN string, ignoreReqs bool, esxCompat bool, disableLocking bool, ) (*reqs.DBReqs, error)
MigrateDB runs database migrations using golang-migrate, logging progress and errors. It prepares the DSN, connects to the DB, runs migrations, and logs the result.
Types ¶
type MigrateLogger ¶
type MigrateLogger struct {
// contains filtered or unexported fields
}
MigrateLogger implements the migrate.Logger interface using zap.Logger for logging migration output.
func NewMigrateLogger ¶
func NewMigrateLogger(logger *zap.Logger) *MigrateLogger
NewMigrateLogger creates a new MigrateLogger with the given zap.Logger. The logger is named "migrate" and verbosity is set based on the logger's level.
func (*MigrateLogger) Printf ¶
func (l *MigrateLogger) Printf(format string, v ...any)
Printf logs formatted migration output using zap at Info level.
func (*MigrateLogger) Verbose ¶
func (l *MigrateLogger) Verbose() bool
Verbose returns true if verbose logging output is wanted for migrations.
type Params ¶
type Params struct {
fx.In
// LC is the Fx lifecycle for managing start/stop hooks.
LC fx.Lifecycle
// Logger is the zap logger instance for logging.
Logger *zap.Logger
// Config is the application configuration.
Config *config.Config
}
Params contains dependencies for constructing the database connection and managing its lifecycle.
Click to show internal directories.
Click to hide internal directories.