Documentation
¶
Index ¶
- Constants
- type BackupMeta
- type LocalManager
- func (m *LocalManager) CloseGame(targetName string) (string, error)
- func (m *LocalManager) CreateManualBackup(targetName string) error
- func (m *LocalManager) DeleteSaveBackup(targetName, backupName string) error
- func (m *LocalManager) DeployAndLaunch(targetName string, localPath string) error
- func (m *LocalManager) DownloadBackup(targetName, backupName, localPath string) error
- func (m *LocalManager) DownloadSave(targetName string, localPath string) error
- func (m *LocalManager) LaunchGame(targetName string) (string, error)
- func (m *LocalManager) ListBackups(targetName string) ([]SaveBackupEntry, error)
- func (m *LocalManager) SetActiveBackup(targetName, backupName string) error
- func (m *LocalManager) TestConnection(targetName string) (string, error)
- func (m *LocalManager) UnsetActiveBackup(targetName string) error
- func (m *LocalManager) UpdateBackupMeta(targetName, backupName string, tags []string, desc string) error
- func (m *LocalManager) UploadSave(targetName string, localPath string) error
- type SSHManager
- func (m *SSHManager) CloseGame(targetName string) (string, error)
- func (m *SSHManager) CreateManualBackup(targetName string) error
- func (m *SSHManager) DeleteSaveBackup(targetName, backupName string) error
- func (m *SSHManager) DeployAndLaunch(targetName string, localPath string) error
- func (m *SSHManager) DownloadBackup(targetName, backupName, localPath string) error
- func (m *SSHManager) DownloadSave(targetName string, localPath string) error
- func (m *SSHManager) LaunchGame(targetName string) (string, error)
- func (m *SSHManager) ListBackups(targetName string) ([]SaveBackupEntry, error)
- func (m *SSHManager) SetActiveBackup(targetName, backupName string) error
- func (m *SSHManager) TestConnection(targetName string) (string, error)
- func (m *SSHManager) UnsetActiveBackup(targetName string) error
- func (m *SSHManager) UpdateBackupMeta(targetName, backupName string, tags []string, desc string) error
- func (m *SSHManager) UploadSave(targetName string, localPath string) error
- type SaveBackupEntry
- type Target
- type TargetStore
Constants ¶
const ( DefaultPort = 22 DefaultSavePath = "" /* 134-byte string literal not displayed */ DefaultStartCmd = "steam steam://rungameid/1245620" DefaultStopCmd = "pkill -TERM -f eldenring.exe" )
const ( TargetTypeSSH = "ssh" TargetTypeLocal = "local" )
Target type constants.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BackupMeta ¶ added in v1.0.0
type BackupMeta struct {
MD5 string `json:"md5"`
Tags []string `json:"tags"`
Desc string `json:"desc"`
CreatedAt time.Time `json:"created_at"`
}
BackupMeta is stored as a .json sidecar next to each .bak file.
type LocalManager ¶
type LocalManager struct {
// contains filtered or unexported fields
}
LocalManager handles local file copy and game launch/stop operations.
func NewLocalManager ¶
func NewLocalManager(store *TargetStore) *LocalManager
NewLocalManager creates a new local operations manager.
func (*LocalManager) CloseGame ¶
func (m *LocalManager) CloseGame(targetName string) (string, error)
CloseGame stops the game using the configured command or platform default.
func (*LocalManager) CreateManualBackup ¶ added in v1.0.0
func (m *LocalManager) CreateManualBackup(targetName string) error
CreateManualBackup copies the active ER0000.sl2 to a new timestamped .bak file.
func (*LocalManager) DeleteSaveBackup ¶ added in v1.0.0
func (m *LocalManager) DeleteSaveBackup(targetName, backupName string) error
DeleteSaveBackup deletes a .bak file (and its .json sidecar). Returns an error if the backup is currently active.
func (*LocalManager) DeployAndLaunch ¶
func (m *LocalManager) DeployAndLaunch(targetName string, localPath string) error
DeployAndLaunch performs: close game → wait → copy save → launch.
func (*LocalManager) DownloadBackup ¶ added in v1.0.0
func (m *LocalManager) DownloadBackup(targetName, backupName, localPath string) error
DownloadBackup copies a .bak file to a local destination path.
func (*LocalManager) DownloadSave ¶
func (m *LocalManager) DownloadSave(targetName string, localPath string) error
DownloadSave copies the save file from the target path to a local path.
func (*LocalManager) LaunchGame ¶
func (m *LocalManager) LaunchGame(targetName string) (string, error)
LaunchGame starts the game using the configured command or platform default.
func (*LocalManager) ListBackups ¶ added in v1.0.0
func (m *LocalManager) ListBackups(targetName string) ([]SaveBackupEntry, error)
ListBackups returns all .bak files in the local target's save directory.
func (*LocalManager) SetActiveBackup ¶ added in v1.0.0
func (m *LocalManager) SetActiveBackup(targetName, backupName string) error
SetActiveBackup copies the named .bak file over ER0000.sl2 and writes the active marker.
func (*LocalManager) TestConnection ¶
func (m *LocalManager) TestConnection(targetName string) (string, error)
TestConnection verifies the local save path is accessible.
func (*LocalManager) UnsetActiveBackup ¶ added in v1.0.0
func (m *LocalManager) UnsetActiveBackup(targetName string) error
UnsetActiveBackup removes ER0000.sl2 from the local target. If no existing .bak has a matching md5, the active file is first moved to a new .bak.
func (*LocalManager) UpdateBackupMeta ¶ added in v1.0.0
func (m *LocalManager) UpdateBackupMeta(targetName, backupName string, tags []string, desc string) error
UpdateBackupMeta rewrites the .json sidecar for a backup with new tags and description.
func (*LocalManager) UploadSave ¶
func (m *LocalManager) UploadSave(targetName string, localPath string) error
UploadSave copies a local save file to the target path. Creates a timestamped backup before overwriting.
type SSHManager ¶
type SSHManager struct {
// contains filtered or unexported fields
}
SSHManager handles SSH connections and remote operations for deploy targets.
func NewSSHManager ¶
func NewSSHManager(store *TargetStore) *SSHManager
NewSSHManager creates a new SSH manager backed by the given target store.
func (*SSHManager) CloseGame ¶
func (m *SSHManager) CloseGame(targetName string) (string, error)
CloseGame executes the game stop command on the remote target.
func (*SSHManager) CreateManualBackup ¶ added in v1.0.0
func (m *SSHManager) CreateManualBackup(targetName string) error
CreateManualBackup copies the active ER0000.sl2 to a new timestamped .bak file.
func (*SSHManager) DeleteSaveBackup ¶ added in v1.0.0
func (m *SSHManager) DeleteSaveBackup(targetName, backupName string) error
DeleteSaveBackup deletes a .bak file (and its .json sidecar) from the target. Returns an error if the backup is currently active.
func (*SSHManager) DeployAndLaunch ¶
func (m *SSHManager) DeployAndLaunch(targetName string, localPath string) error
DeployAndLaunch performs the full workflow: close game → wait → upload → launch.
func (*SSHManager) DownloadBackup ¶ added in v1.0.0
func (m *SSHManager) DownloadBackup(targetName, backupName, localPath string) error
DownloadBackup copies a .bak file from the remote target to a local path.
func (*SSHManager) DownloadSave ¶
func (m *SSHManager) DownloadSave(targetName string, localPath string) error
DownloadSave downloads the save file from the remote target to a local path.
func (*SSHManager) LaunchGame ¶
func (m *SSHManager) LaunchGame(targetName string) (string, error)
LaunchGame executes the game start command on the remote target.
func (*SSHManager) ListBackups ¶ added in v1.0.0
func (m *SSHManager) ListBackups(targetName string) ([]SaveBackupEntry, error)
ListBackups returns all .bak files in the target's save directory.
func (*SSHManager) SetActiveBackup ¶ added in v1.0.0
func (m *SSHManager) SetActiveBackup(targetName, backupName string) error
SetActiveBackup copies the named .bak file over ER0000.sl2 and writes the active marker.
func (*SSHManager) TestConnection ¶
func (m *SSHManager) TestConnection(targetName string) (string, error)
TestConnection verifies SSH connectivity to a target. Returns host info on success.
func (*SSHManager) UnsetActiveBackup ¶ added in v1.0.0
func (m *SSHManager) UnsetActiveBackup(targetName string) error
UnsetActiveBackup removes ER0000.sl2 from the target. If no existing .bak has a matching md5, the active file is first moved to a new .bak.
func (*SSHManager) UpdateBackupMeta ¶ added in v1.0.0
func (m *SSHManager) UpdateBackupMeta(targetName, backupName string, tags []string, desc string) error
UpdateBackupMeta rewrites the .json sidecar for a backup with new tags and description.
func (*SSHManager) UploadSave ¶
func (m *SSHManager) UploadSave(targetName string, localPath string) error
UploadSave uploads a local save file to the remote target. It creates a timestamped backup of the remote file before overwriting.
type SaveBackupEntry ¶ added in v1.0.0
type SaveBackupEntry struct {
Name string `json:"name"`
Timestamp string `json:"timestamp"`
Size int64 `json:"size"`
MD5 string `json:"md5"`
Tags []string `json:"tags"`
Desc string `json:"desc"`
IsActive bool `json:"isActive"`
}
SaveBackupEntry is returned to the frontend for each .bak file found on a target. Timestamp is an RFC3339 string so Wails can represent it as a plain TypeScript string.
type Target ¶
type Target struct {
Type string `json:"type"` // "ssh" or "local"
Name string `json:"name"`
Host string `json:"host"`
Port int `json:"port"`
User string `json:"user"`
KeyPath string `json:"keyPath"`
SavePath string `json:"savePath"`
GameStartCmd string `json:"gameStartCmd"`
GameStopCmd string `json:"gameStopCmd"`
}
Target represents a deploy destination — either a remote SSH host or a local directory.
type TargetStore ¶
type TargetStore struct {
// contains filtered or unexported fields
}
TargetStore manages persistent storage of deploy targets.
func NewTargetStore ¶
func NewTargetStore() (*TargetStore, error)
NewTargetStore creates a store that reads/writes targets.json in the app config directory.
func (*TargetStore) Delete ¶
func (s *TargetStore) Delete(name string) error
Delete removes a target by name and persists to disk.
func (*TargetStore) Get ¶
func (s *TargetStore) Get(name string) (Target, bool)
Get returns a target by name.
func (*TargetStore) List ¶
func (s *TargetStore) List() []Target
List returns all configured targets.
func (*TargetStore) Save ¶
func (s *TargetStore) Save(t Target) error
Save adds or updates a target and persists to disk.