Documentation
¶
Index ¶
- Constants
- Variables
- func AcquireFileLock(path string, appVersion string) (func() error, error)
- func ClearJournal(path string) error
- func CreateBackup(ctx context.Context, uc *Context, backupID string) (string, error)
- func SaveJournal(path string, journal Journal) error
- func SaveMeta(path string, meta Meta) error
- func UpgradeIfNeeded(ctx context.Context, resolved *appconfig.Resolved, appVersion string) error
- type Context
- type Detection
- type Inspection
- type Journal
- type Meta
- type Migration
- type Paths
- type Upgrader
Constants ¶
View Source
const (
LatestWorkspaceSchemaVersion = 3
)
Variables ¶
View Source
var ErrUpgradeLocked = errors.New("workspace upgrade is already running")
Functions ¶
func ClearJournal ¶
func CreateBackup ¶
func SaveJournal ¶
Types ¶
type Context ¶
type Detection ¶
type Detection struct {
CurrentVersion int `json:"current_version"`
LatestVersion int `json:"latest_version"`
CurrentVersionSource string `json:"current_version_source"`
Empty bool `json:"empty"`
HasWorkspace bool `json:"has_workspace"`
HasLegacy bool `json:"has_legacy"`
ConfigExists bool `json:"config_exists"`
LegacyConfigExists bool `json:"legacy_config_exists"`
ConfigSchemaVersion int `json:"config_schema_version"`
ConfigError string `json:"config_error,omitempty"`
IdentityIndexExists bool `json:"identity_index_exists"`
IdentityIndexSchemaVersion int `json:"identity_index_schema_version"`
IdentityIndexError string `json:"identity_index_error,omitempty"`
DatabaseExists bool `json:"database_exists"`
DatabaseSchemaVersion int `json:"database_schema_version"`
DatabaseError string `json:"database_error,omitempty"`
LegacyIdentityExists bool `json:"legacy_identity_exists"`
LegacyIdentityError string `json:"legacy_identity_error,omitempty"`
LegacyDatabaseExists bool `json:"legacy_database_exists"`
LegacyDatabaseError string `json:"legacy_database_error,omitempty"`
LegacySettingsExists bool `json:"legacy_settings_exists"`
}
type Inspection ¶
type Journal ¶
type Journal struct {
UpgradeID string `json:"upgrade_id"`
FromVersion int `json:"from_version"`
ToVersion int `json:"to_version"`
CurrentStep string `json:"current_step"`
Phase string `json:"phase"`
BackupDir string `json:"backup_dir,omitempty"`
StartedAt string `json:"started_at"`
AppVersion string `json:"app_version,omitempty"`
}
func LoadJournal ¶
type Meta ¶
type Meta struct {
WorkspaceSchemaVersion int `json:"workspace_schema_version"`
AppVersion string `json:"app_version,omitempty"`
UpdatedAt string `json:"updated_at"`
LastUpgradeID string `json:"last_upgrade_id,omitempty"`
LastBackupDir string `json:"last_backup_dir,omitempty"`
Warnings []string `json:"warnings,omitempty"`
}
type Paths ¶
type Paths struct {
ConfigFile string `json:"config_file"`
LegacyConfigFile string `json:"legacy_config_file"`
IdentityDir string `json:"identity_dir"`
DatabaseFile string `json:"database_file"`
LegacyCredentialsDir string `json:"legacy_credentials_dir"`
LegacyDataDir string `json:"legacy_data_dir"`
LegacySettingsPath string `json:"legacy_settings_path"`
MetaPath string `json:"meta_path"`
JournalPath string `json:"journal_path"`
LockPath string `json:"lock_path"`
BackupRoot string `json:"backup_root"`
}
func ResolvePaths ¶
type Upgrader ¶
type Upgrader struct {
// contains filtered or unexported fields
}
func NewDefaultUpgrader ¶
func NewDefaultUpgrader() *Upgrader
Click to show internal directories.
Click to hide internal directories.