runner

package
v0.0.0-...-dbf8e86 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Runner

type Runner struct {
	Db              *dal.Db
	ServerInstances map[int64]*ServerInstance
	McPath          string
	LogFolder       string
	ServersFolder   string
	BackupsFolder   string
}

func (Runner) Backup

func (r Runner) Backup(name string, worldId int64, c echo.Context) error

Backup current world

func (Runner) BackupUtil

func (r Runner) BackupUtil(name string, worldId int64, c echo.Context) error

BackupUtil is used by backup and restore

func (Runner) CleanOldBackups

func (r Runner) CleanOldBackups(worldId, days int64, c echo.Context) error

CleanOldBackups deletes backups older than days

func (Runner) DeleteBackup

func (r Runner) DeleteBackup(id int64, c echo.Context) error

func (Runner) DeleteServer

func (r Runner) DeleteServer(id int64, c echo.Context) error

func (Runner) DeleteWorld

func (r Runner) DeleteWorld(id int64, c echo.Context) error

func (Runner) GetServer

func (r Runner) GetServer(version string, c echo.Context) error

GetServer downloads a version of server

func (Runner) InitDir

func (r Runner) InitDir() error

InitDir mkdir for McPath, ServersFolder, BackupsFolder Only run one time

func (Runner) Restore

func (r Runner) Restore(id int64, ifBackup bool, c echo.Context) error

Restore a backup

func (Runner) Start

func (r Runner) Start(worldId int64) error

func (Runner) Stop

func (r Runner) Stop(worldId int64) error

func (Runner) UploadSaveData

func (r Runner) UploadSaveData(worldId int64, worldFile *multipart.FileHeader, c echo.Context) error

UploadSaveData receives and unzips a world file for later usage

func (Runner) UseServer

func (r Runner) UseServer(serverId, worldId int64, c echo.Context) error

UseServer uses a version of server for a world

type ServerInstance

type ServerInstance struct {
	Running bool
	// contains filtered or unexported fields
}

func (*ServerInstance) Start

func (s *ServerInstance) Start(logPath, serverPath string, world dal.Worlds) error

func (*ServerInstance) Stop

func (s *ServerInstance) Stop() error

Jump to

Keyboard shortcuts

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