Documentation
¶
Overview ¶
Package lifecycle adapts Goose providers to startup policy and native commands. Callers own database modules and supply fresh, late-bound providers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Commands ¶
func Commands(config lifecycle.Config, modules []lifecycle.Module, provider func(context.Context) (*goose.Provider, error)) *urfavecli.Command
Commands returns a fresh native migrate group using exactly modules, with services suppressed. Supply database modules only, excluding startup policy. Resolvers run after setup. Help/usage starts nothing; Action owns signals and reverse cleanup. Use fresh trees and bindings for independent invocations. Status may initialize the version table; it does not run migration bodies.
func Module ¶
func Module(name string, policy Policy, provider func(context.Context) (*goose.Provider, error)) (lifecycle.Module, error)
Module declares startup migration work without resolving provider yet. Register it after the database module and before dependent modules. The resolver must return fresh registrations and clean up any partial acquisition. Teardown never closes the provider: the database module owns its database.