Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrMigrationConfigMissing = errors.New("migration configuration is missing")
Functions ¶
func SetDefaultConfigValues ¶
func SetDefaultConfigValues(config *Config)
SetDefaultConfigValues sets default values for Config fields if they are not set.
Types ¶
type Config ¶
type Config struct { Driver string DatabaseName string DataSourceName string PathMigration string Scheme string Table string ConnMaxLifetime time.Duration }
Config is registry configuration item.
type Migrate ¶
type Migrate struct {
// contains filtered or unexported fields
}
func NewWithConfig ¶
NewWithConfig creates a new instance of Migrate using the provided Config.
type SQLMigrator ¶
type SQLMigrator interface { Up(ctx context.Context) error Down(ctx context.Context, max int) error }
SQLMigrator works with migrations
func NewWithViper ¶
func NewWithViper(cfg *viper.Viper) (SQLMigrator, error)
NewWithViper creates a new instance of a migration.
Click to show internal directories.
Click to hide internal directories.