application

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: May 24, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Migrator

type Migrator struct {
	// contains filtered or unexported fields
}

Migrator can migrate the database up and down using the migration scripts

func (*Migrator) Down

func (m *Migrator) Down(steps *int) error

Down looks at the currently active migration version and will migrate step versions down or applying all down migrations if step is not given

func (*Migrator) Inject

func (m *Migrator) Inject(
	db db.DB,
	logger flamingo.Logger,
	conf *struct {
		DatabaseName       string `inject:"config:mysql.db.databaseName,optional"`
		MigrationDirectory string `inject:"config:mysql.migration.directory"`
	},
)

Inject dependencies

func (*Migrator) Up

func (m *Migrator) Up(steps *int) error

Up looks at the currently active migration version and will migrate step versions up or applying all up migrations if step is not given

type Seeder

type Seeder struct {
	// contains filtered or unexported fields
}

Seeder can import the test data into the database

func (*Seeder) Inject

func (s *Seeder) Inject(
	db db.DB,
	logger flamingo.Logger,
	conf *struct {
		SeedsDirectory string `inject:"config:mysql.seed.directory"`
	},
)

Inject dependencies

func (*Seeder) Seed

func (s *Seeder) Seed() error

Seed runs all sql files in the seeding directory

type StartUpMigrations

type StartUpMigrations struct {
	// contains filtered or unexported fields
}

StartUpMigrations subscribes to the AppStartup

func (*StartUpMigrations) Inject

func (s *StartUpMigrations) Inject(
	m *Migrator,
	l flamingo.Logger,
)

Inject dependencies

func (*StartUpMigrations) Notify

func (s *StartUpMigrations) Notify(_ context.Context, event flamingo.Event)

Notify handles the automigration if configured on the AppStartupEvent

Jump to

Keyboard shortcuts

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