examplemigrator

package
v1.2.11 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const ServiceName = "example-migrator"

Variables

This section is empty.

Functions

This section is empty.

Types

type ExampleMigrator

type ExampleMigrator struct{}

ExampleMigrator demonstrates a one-shot service with dependency behavior and CLI commands. It depends on "example-database", runs its migrations, and exits cleanly. It also implements Commander to expose ./app example-migrator up|down|status commands.

func New

func New() (*ExampleMigrator, error)

func (*ExampleMigrator) Commands added in v1.0.3

func (m *ExampleMigrator) Commands() []*cobra.Command

Commands makes ExampleMigrator implement the Commander interface. These are available as:

./app example-migrator up
./app example-migrator down
./app example-migrator status

func (*ExampleMigrator) Dependencies

func (m *ExampleMigrator) Dependencies() []string

Dependencies makes ExampleMigrator implement the Dependent interface. Starts after example-database.

func (*ExampleMigrator) IsAllowedFailure

func (m *ExampleMigrator) IsAllowedFailure() bool

IsAllowedFailure makes ExampleMigrator implement the AllowedFailure interface. Migration failures don't bring down the whole app.

func (*ExampleMigrator) Name

func (m *ExampleMigrator) Name() string

func (*ExampleMigrator) Run

func (m *ExampleMigrator) Run(
	_ context.Context,
) error

func (*ExampleMigrator) Stop

func (m *ExampleMigrator) Stop(
	_ context.Context,
) error

Jump to

Keyboard shortcuts

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