command

package
v0.4.6 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: MIT Imports: 11 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApplyCommand

type ApplyCommand struct {
	Meta
	// contains filtered or unexported fields
}

ApplyCommand is a command which computes a new state and pushes it to the remote state.

func (*ApplyCommand) Help

func (c *ApplyCommand) Help() string

Help returns long-form help text.

func (*ApplyCommand) Run

func (c *ApplyCommand) Run(args []string) int

Run runs the procedure of this command.

func (*ApplyCommand) Synopsis

func (c *ApplyCommand) Synopsis() string

Synopsis returns one-line help text.

type FileRunner added in v0.2.0

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

FileRunner is a runner for a single migration file.

func NewFileRunner added in v0.2.0

func NewFileRunner(filename string, config *config.TfmigrateConfig, option *tfmigrate.MigratorOption) (*FileRunner, error)

NewFileRunner returns a new FileRunner instance.

func (*FileRunner) Apply added in v0.2.0

func (r *FileRunner) Apply(ctx context.Context) error

Apply applies a single migration.

func (*FileRunner) MigrationConfig added in v0.2.0

func (r *FileRunner) MigrationConfig() *tfmigrate.MigrationConfig

MigrationConfig returns an instance of migration. This is required for metadata stored in history

func (*FileRunner) Plan added in v0.2.0

func (r *FileRunner) Plan(ctx context.Context) error

Plan plans a single migration.

type HistoryRunner added in v0.2.0

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

HistoryRunner is a history-aware runner. It allows us to apply all unapplied migrations and save them to history.

func NewHistoryRunner added in v0.2.0

func NewHistoryRunner(ctx context.Context, filename string, config *config.TfmigrateConfig, option *tfmigrate.MigratorOption) (*HistoryRunner, error)

NewHistoryRunner returns a new HistoryRunner instance.

func (*HistoryRunner) Apply added in v0.2.0

func (r *HistoryRunner) Apply(ctx context.Context) (err error)

Apply applies migrations and save them to history. If a filename is set, run a single migration. If not set, run all unapplied migrations.

func (*HistoryRunner) Plan added in v0.2.0

func (r *HistoryRunner) Plan(ctx context.Context) error

Plan plans migrations with history-aware mode. If a filename is set, run a single migration. If not set, run all unapplied migrations.

type ListCommand added in v0.2.13

type ListCommand struct {
	Meta
	// contains filtered or unexported fields
}

ListCommand is a command which lists migrations.

func (*ListCommand) Help added in v0.2.13

func (c *ListCommand) Help() string

Help returns long-form help text.

func (*ListCommand) Run added in v0.2.13

func (c *ListCommand) Run(args []string) int

Run runs the procedure of this command.

func (*ListCommand) Synopsis added in v0.2.13

func (c *ListCommand) Synopsis() string

Synopsis returns one-line help text.

type Meta

type Meta struct {
	// UI is a user interface representing input and output.
	UI cli.Ui

	// Option customizes a behavior of Migrator.
	// It is used for shared settings across Migrator instances.
	Option *tfmigrate.MigratorOption
	// contains filtered or unexported fields
}

Meta are the meta-options that are available on all or most commands.

type PlanCommand

type PlanCommand struct {
	Meta
	// contains filtered or unexported fields
}

PlanCommand is a command which computes a new state by applying state migration operations to a temporary state.

func (*PlanCommand) Help

func (c *PlanCommand) Help() string

Help returns long-form help text.

func (*PlanCommand) Run

func (c *PlanCommand) Run(args []string) int

Run runs the procedure of this command.

func (*PlanCommand) Synopsis

func (c *PlanCommand) Synopsis() string

Synopsis returns one-line help text.

Jump to

Keyboard shortcuts

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