migrationgate

package
v0.8.6 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package migrationgate decides whether the old instance is safe to delete. It is pure: callers pass in what the migration job recorded and what the live probes saw, and a gate only passes on evidence, never on absence of failure.

Index

Constants

View Source
const (
	GateStaged    = "staged"
	GateLeftovers = "leftovers"
	GateVolumes   = "volumes"
	GateDatabases = "databases"
	GateRouted    = "routed"
	GateDNS       = "dns"
	GateResponds  = "responds"
	GateBackup    = "source-backup"
	GateTraffic   = "traffic-cycle"
)

Gate IDs, in the order they are evaluated. The last three double as the acknowledgment IDs a caller passes in Input.Acknowledged.

Variables

This section is empty.

Functions

func Fallback

func Fallback() []string

Fallback is the rollback guidance shown next to the checklist.

Types

type Database

type Database struct {
	Name string
	// Status is the data copy status: verified, copying, failed, pending, or empty when never started.
	Status     string
	Mismatched int
}

Database is one source database the selected apps use and the state of its data copy.

type Gate

type Gate struct {
	ID     string   `json:"id"`
	Status Status   `json:"status"`
	Detail string   `json:"detail"`
	Open   []string `json:"open,omitempty"`
	Fix    string   `json:"fix,omitempty"`
}

Gate is one line of the checklist.

type Input

type Input struct {
	Items        []Item
	Databases    []Database
	Probes       []Probe
	Acknowledged []string
}

Input is everything the gates look at. Nil Probes means no probe ran yet.

type Item

type Item struct {
	Name    string
	State   string
	Domains []string
	Volumes []Volume
	// Leftover is true for an unsupported resource the importer cannot move.
	Leftover bool
}

Item uses the import state strings of the job: verified and routed count as proven here.

type Probe

type Probe struct {
	Domain   string
	DNS      bool
	Responds bool
}

Probe is one live result for a domain.

type Report

type Report struct {
	Safe     bool           `json:"safe_to_delete"`
	Gates    []Gate         `json:"gates"`
	Counts   map[Status]int `json:"counts"`
	Fallback []string       `json:"fallback"`
}

Report is the checklist. Safe is true only when every gate passed.

func Evaluate

func Evaluate(in Input) Report

Evaluate runs every gate.

type Status

type Status string

Status is the outcome of one gate.

const (
	Pass Status = "pass"
	Fail Status = "fail"
	// Pending means the evidence has not been gathered yet, so the gate cannot pass.
	Pending Status = "pending"
	// Manual is a step only a person can confirm.
	Manual Status = "manual"
)

Gate outcomes.

type Volume

type Volume struct {
	Name   string
	Copied bool
}

Volume is one persistent mount and whether its copy completed.

Jump to

Keyboard shortcuts

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