Documentation
¶
Index ¶
Constants ¶
const CurrentVersion = "1.2.0"
CurrentVersion is the latest setup version
const LegacySetupMarker = "/etc/tako/setup.complete"
LegacySetupMarker is the old setup completion marker
const VersionFile = "/etc/tako/version.json"
VersionFile is the location of the version manifest on servers
Variables ¶
var ErrNotSetup = fmt.Errorf("server not set up")
ErrNotSetup indicates server is not set up
Functions ¶
func WriteVersionFile ¶
func WriteVersionFile(client *ssh.Client, version *ServerVersion) error
WriteVersionFile writes the version manifest to the server
Types ¶
type Logger ¶
type Logger interface {
Log(format string, args ...interface{})
}
Logger interface for upgrade logging
type ServerVersion ¶
type ServerVersion struct {
Version string `json:"version"`
InstalledAt time.Time `json:"installed_at"`
LastUpgrade time.Time `json:"last_upgrade,omitempty"`
Components map[string]string `json:"components"`
Features []string `json:"features"`
TakoCLIVersion string `json:"tako_cli_version"`
}
ServerVersion represents the installed setup version on a server
func DetectServerVersion ¶
func DetectServerVersion(client *ssh.Client) (*ServerVersion, error)
DetectServerVersion detects the setup version installed on a server
func (*ServerVersion) IsOutdated ¶
func (v *ServerVersion) IsOutdated() bool
IsOutdated checks if version is more than one major version behind
func (*ServerVersion) IsUpgradeAvailable ¶
func (v *ServerVersion) IsUpgradeAvailable() bool
IsUpgradeAvailable checks if an upgrade is available
func (*ServerVersion) NeedsUpgrade ¶
func (v *ServerVersion) NeedsUpgrade() bool
NeedsUpgrade checks if upgrade is recommended
type UpgradePath ¶
type UpgradePath struct {
From string
To string
Steps []UpgradeStep
}
UpgradePath represents the path from one version to another
func PlanUpgrade ¶
func PlanUpgrade(from, to string) (*UpgradePath, error)
PlanUpgrade plans the upgrade path from current version to target
type UpgradeStep ¶
type UpgradeStep struct {
Version string
Description string
Execute func(*ssh.Client) error
Rollback func(*ssh.Client) error
Validate func(*ssh.Client) error
}
UpgradeStep represents a single upgrade step
type Upgrader ¶
type Upgrader struct {
// contains filtered or unexported fields
}
Upgrader handles server setup upgrades
func NewUpgrader ¶
NewUpgrader creates a new upgrader instance
func (*Upgrader) Execute ¶
func (u *Upgrader) Execute(path *UpgradePath) error
Execute executes the upgrade with automatic backup and rollback