modelmigration

package
v0.0.0-...-fab76b5 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2025 License: AGPL-3.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterImport

func RegisterImport(
	coordinator Coordinator,
	clock clock.Clock,
	logger logger.Logger,
)

RegisterImport registers the import operations with the given coordinator.

Types

type Coordinator

type Coordinator interface {
	// Add adds the given operation to the migration.
	Add(modelmigration.Operation)
}

Coordinator is the interface that is used to add operations to a migration.

type ImportService

type ImportService interface {
	// ImportResources sets resources imported in migration. It first builds all the
	// resources to insert from the arguments, then inserts them at the end so as to
	// wait as long as possible before turning into a write transaction.
	ImportResources(ctx context.Context, args resource.ImportResourcesArgs) error

	// DeleteImportedResources deletes all imported resource associated with the
	// given applications during an import rollback.
	DeleteImportedResources(
		ctx context.Context,
		appNames []string,
	) error
}

ImportService provides a subset of the resource domain service methods needed for resource import.

Jump to

Keyboard shortcuts

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