Documentation
¶
Index ¶
- Variables
- func CreateMigration(m *model.Migration) error
- func CreateMigrationLog(entry *model.MigrationLog) error
- func DeleteMigration(id string) error
- func FailInterruptedValidations() (int64, error)
- func GetMigration(id string) (*model.Migration, error)
- func ListAllMigration(f model.MigrationListFilter) ([]model.MigrationSummary, error)
- func ListAllMigrationLog(migrationID, status string) ([]model.MigrationLog, error)
- func ListMigration(f model.MigrationListFilter, page, pageSize int) ([]model.MigrationSummary, int64, error)
- func ListMigrationLog(migrationID, status string, page, pageSize int) ([]model.MigrationLog, int64, error)
- func UpdateMigrationStatus(m *model.Migration) error
- func UpdateMigrationValidation(m *model.Migration) error
Constants ¶
This section is empty.
Variables ¶
var ErrMigrationRunning = errors.New("migration is running")
ErrMigrationRunning is returned when an operation is blocked because the migration is currently in the "running" state (e.g. delete while running).
Functions ¶
func CreateMigration ¶
CreateMigration persists a new Migration.
Inline connection credentials and the beetleDb password in the plan are encrypted before writing. The call is idempotent in practice: a plan that arrived from POST /plans/target is already ciphertext and is stored as it came, while a hand-written plaintext plan is sealed here.
func CreateMigrationLog ¶
func CreateMigrationLog(entry *model.MigrationLog) error
CreateMigrationLog persists a single MigrationLog entry.
func DeleteMigration ¶
DeleteMigration deletes the Migration with the given ID. Returns ErrMigrationRunning when status is "running". Returns gorm.ErrRecordNotFound when no row matches.
func FailInterruptedValidations ¶
FailInterruptedValidations marks every validation still recorded as running failed, and returns how many there were.
A validation runs in a goroutine of this process, so at startup none can be running: a "running" row is one a restart cut short. Left alone it would read as running for good, and StartValidation would refuse it with 409 forever.
func GetMigration ¶
GetMigration returns the Migration with the given ID, its plan still encrypted.
Nothing is decrypted here. The migration resolvers decrypt one ref at a time as they build each transfer, so a plan decrypted this early would only mean plaintext credentials sitting in every caller — including the ones whose answer goes straight into an HTTP response.
func ListAllMigration ¶
func ListAllMigration(f model.MigrationListFilter) ([]model.MigrationSummary, error)
ListAllMigration returns every migration summary matching f, ordered by created_at DESC, without pagination. The caller is responsible for bounding the result — see MigrationListFilter.ApplyDefaultWindow.
func ListAllMigrationLog ¶
func ListAllMigrationLog(migrationID, status string) ([]model.MigrationLog, error)
ListAllMigrationLog returns every log for migrationID without pagination, optionally filtered by status ("success" | "failed" | "skipped").
func ListMigration ¶
func ListMigration(f model.MigrationListFilter, page, pageSize int) ([]model.MigrationSummary, int64, error)
ListMigration returns a paginated list of migration summaries matching f, ordered by created_at DESC.
func ListMigrationLog ¶
func ListMigrationLog(migrationID, status string, page, pageSize int) ([]model.MigrationLog, int64, error)
ListMigrationLog returns a paginated list of logs for migrationID, optionally filtered by status ("success" | "failed" | "skipped").
func UpdateMigrationStatus ¶
UpdateMigrationStatus updates only the status and progress fields, leaving the plan column untouched. Use this during execution to avoid re-encrypting the plan on every progress tick.
func UpdateMigrationValidation ¶
UpdateMigrationValidation updates only the validation fields (status, message, details), leaving plan, status, and progress columns untouched. Use this after a validation run completes to persist results without re-encrypting the plan.
Types ¶
This section is empty.