Documentation
¶
Index ¶
Constants ¶
View Source
const ( // ContainerID defines the id to be used as the container // registration id of a migrator instance, and as a base id of all // other migration package instances registered in the application // container. ContainerID = gapp.ContainerID + ".migrator" // ContainerDaoID defines the id to be used as the container // registration id of the migrator DAO. ContainerDaoID = ContainerID + ".dao" // ContainerMigrationTag defines the default tag to be used // to identify a migration entry in the container. ContainerMigrationTag = ContainerID + ".migration" )
Variables ¶
View Source
var ( // ErrNilPointer defines a nil pointer argument error ErrNilPointer = gapp.ErrNilPointer // ErrConversion defines a type conversion error ErrConversion = gapp.ErrConversion )
View Source
var ( // Database defines the default migration manager rdb name. Database = genv.String("GAPP_MIGRATOR_DATABASE", "primary") // AutoMigrate defines the flag that will be used to enable // the auto migration on application boot. AutoMigrate = genv.Bool("GAPP_MIGRATOR_AUTO_MIGRATE", true) )
Functions ¶
func GetDao ¶
func GetDao(c gapp.ServiceContainer) (*gmigration.Dao, error)
GetDao will try to retrieve a new migration DAO instances from the application service container.
func GetMigrations ¶
func GetMigrations(c gapp.ServiceContainer) ([]gmigration.Migration, error)
GetMigrations will try to retrieve the registered the list of migration instances from the application service container.
func GetMigrator ¶
func GetMigrator(c gapp.ServiceContainer) (*gmigration.Migrator, error)
GetMigrator will try to retrieve a new migrator instance from the application service container.
Types ¶
type Provider ¶
type Provider struct{}
Provider defines the gapp/migration module service provider to be used on the application initialization to register the migrations service.
Click to show internal directories.
Click to hide internal directories.