setup

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const CurrentVersion = "1.2.0"

CurrentVersion is the latest setup version

View Source
const LegacySetupMarker = "/etc/tako/setup.complete"

LegacySetupMarker is the old setup completion marker

View Source
const VersionFile = "/etc/tako/version.json"

VersionFile is the location of the version manifest on servers

Variables

View Source
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

func NewUpgrader(client *ssh.Client, logger Logger) *Upgrader

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

Jump to

Keyboard shortcuts

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