Documentation
¶
Overview ¶
Package migratesvc brings a home from an earlier release to the current layout.
The config home moved twice: ~/.sshmgr and ~/.config/sshmgr (sshmgr), then ~/.config/ssh-manager (%APPDATA%\ssh-manager on Windows; ssh-manager and authama 0.1.0), and now ~/.config/authama on every OS. Migration COPIES the newest legacy home into the current one and leaves the old folder where it was, with a MIGRATED-TO-AUTHAMA.txt marker in it, so an older binary still installed beside this one keeps working and nothing is lost if the copy is not what the user wanted. It runs once on its own (AutoMigrate, the first time authama starts with no home), and `authama migrate` is the guided path for when both homes already exist.
The tool's own state - log/, snapshots/, dist/ and .state/ - then moves out of the config home into the state home (RelocateState) when those differ.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RelocateState ¶ added in v0.1.1
RelocateState moves the state folders a config home from before 0.1.1 holds (log/, snapshots/, dist/, .state/) into a separate state home. A folder already present in the state home is left where it is and reported, never merged. It does nothing when the state home is the config home.
Types ¶
type Result ¶
type Result struct {
Moved bool
Legacy string
Home string
Backup string
Message string
// Relocated lists the state folders moved to the state home.
Relocated []string
}
Result is the outcome of a migrate run.
func AutoMigrate ¶ added in v0.1.1
AutoMigrate is the first-run migration: when the current home does not exist yet and a legacy one does, copy it in. It does nothing in a sandbox or when the home exists, and reports whether it acted.
func Migrate ¶
Migrate copies the newest legacy home into the current home. If the current home is absent, the legacy one is copied in. If both exist, it refuses unless force - with force the current home is moved aside (using stamp) and replaced by the copy. The legacy folder is kept and marked either way.