Documentation
¶
Index ¶
- Constants
- type ExampleMigrator
- func (m *ExampleMigrator) Commands() []*cobra.Command
- func (m *ExampleMigrator) Dependencies() []string
- func (m *ExampleMigrator) IsAllowedFailure() bool
- func (m *ExampleMigrator) Name() string
- func (m *ExampleMigrator) Run(_ context.Context) error
- func (m *ExampleMigrator) Stop(_ context.Context) error
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
Click to show internal directories.
Click to hide internal directories.