Documentation ¶
Index ¶
- Constants
- Variables
- func MakeFullCommand(cfg workDirReader, server *Server, commandTemplate string, ...) string
- func ReplaceShortCodes(commandTemplate string, cfg workDirReader, server *Server) string
- type APIRequest
- type ErrInvalidResponseFromAPI
- type GDTask
- func (task *GDTask) Command() string
- func (task *GDTask) ID() int
- func (task *GDTask) IsComplete() bool
- func (task *GDTask) IsInstallation() bool
- func (task *GDTask) IsWaiting() bool
- func (task *GDTask) IsWorking() bool
- func (task *GDTask) RunAfterID() int
- func (task *GDTask) Server() *Server
- func (task *GDTask) SetStatus(status GDTaskStatus) error
- func (task *GDTask) Status() GDTaskStatus
- func (task *GDTask) StatusNum() uint8
- func (task *GDTask) Task() GDTaskCommand
- type GDTaskCommand
- type GDTaskRepository
- type GDTaskStats
- type GDTaskStatsReader
- type GDTaskStatus
- type Game
- type GameMod
- type GameModVarTemplate
- type InstallationStatus
- type Result
- type Server
- func (s *Server) AffectInstall()
- func (s *Server) AffectStart()
- func (s *Server) AffectStop()
- func (s *Server) AutoStart() bool
- func (s *Server) Blocked() bool
- func (s *Server) ConnectPort() int
- func (s *Server) Dir() string
- func (s *Server) Enabled() bool
- func (s *Server) Game() Game
- func (s *Server) GameMod() GameMod
- func (s *Server) ID() int
- func (s *Server) IP() string
- func (s *Server) InstallationStatus() InstallationStatus
- func (s *Server) IsActive() bool
- func (s *Server) IsModified() bool
- func (s *Server) IsValueModified(key string) bool
- func (s *Server) LastStatusCheck() time.Time
- func (s *Server) LastTaskCompletedAt() time.Time
- func (s *Server) NoticeTaskCompleted()
- func (s *Server) QueryPort() int
- func (s *Server) RCONPassword() string
- func (s *Server) RCONPort() int
- func (s *Server) RestartCommand() string
- func (s *Server) Set(enabled bool, installStatus InstallationStatus, blocked bool, name string, ...)
- func (s *Server) SetInstallationStatus(status InstallationStatus)
- func (s *Server) SetSetting(key string, value string)
- func (s *Server) SetStatus(processActive bool)
- func (s *Server) Setting(key string) string
- func (s *Server) StartCommand() string
- func (s *Server) StopCommand() string
- func (s *Server) UUID() string
- func (s *Server) UUIDShort() string
- func (s *Server) UnmarkModifiedFlag()
- func (s *Server) UpdateBeforeStart() bool
- func (s *Server) UpdatedAt() time.Time
- func (s *Server) User() string
- func (s *Server) Vars() map[string]string
- func (s *Server) WorkDir(cfg workDirReader) string
- type ServerCommand
- type ServerRepository
- type ServerTask
- func (s *ServerTask) CanExecute() bool
- func (s *ServerTask) Command() ServerTaskCommand
- func (s *ServerTask) Counter() int
- func (s *ServerTask) ExecuteDate() time.Time
- func (s *ServerTask) ID() int
- func (s *ServerTask) IncreaseCountersAndTime()
- func (s ServerTask) MarshalJSON() ([]byte, error)
- func (s *ServerTask) Repeat() int
- func (s *ServerTask) RepeatEndlessly() bool
- func (s *ServerTask) RepeatPeriod() time.Duration
- func (s *ServerTask) Server() *Server
- func (s *ServerTask) Status() ServerTaskStatus
- type ServerTaskCommand
- type ServerTaskRepository
- type ServerTaskStatus
- type Settings
- type SteamAppID
- type SteamSettings
Constants ¶
View Source
const ( ServerNotInstalled = iota ServerInstalled ServerInstallInProcess )
View Source
const AfterInstallScriptName = "gdaemon_after_install.sh"
Variables ¶
View Source
var GDTaskStatusNumMap = map[GDTaskStatus]uint8{ GDTaskStatusWaiting: 1, GDTaskStatusWorking: 2, GDTaskStatusError: 3, GDTaskStatusSuccess: 4, GDTaskStatusCanceled: 5, }
View Source
var StartTime time.Time
Functions ¶
func MakeFullCommand ¶
func ReplaceShortCodes ¶
Types ¶
type APIRequest ¶
type ErrInvalidResponseFromAPI ¶
type ErrInvalidResponseFromAPI struct {
// contains filtered or unexported fields
}
func NewErrInvalidResponseFromAPI ¶
func NewErrInvalidResponseFromAPI(code int, response []byte) ErrInvalidResponseFromAPI
func (ErrInvalidResponseFromAPI) Error ¶
func (err ErrInvalidResponseFromAPI) Error() string
type GDTask ¶
type GDTask struct {
// contains filtered or unexported fields
}
func NewGDTask ¶
func NewGDTask( id int, runAfterID int, server *Server, task GDTaskCommand, cmd string, status GDTaskStatus, ) *GDTask
func (*GDTask) IsComplete ¶
func (*GDTask) IsInstallation ¶
func (*GDTask) RunAfterID ¶
func (*GDTask) SetStatus ¶
func (task *GDTask) SetStatus(status GDTaskStatus) error
func (*GDTask) Status ¶
func (task *GDTask) Status() GDTaskStatus
func (*GDTask) Task ¶
func (task *GDTask) Task() GDTaskCommand
type GDTaskCommand ¶
type GDTaskCommand string
const ( GDTaskGameServerStart GDTaskCommand = "gsstart" GDTaskGameServerPause GDTaskCommand = "gspause" // NOT Implemented GDTaskGameServerStop GDTaskCommand = "gsstop" GDTaskGameServerKill GDTaskCommand = "gskill" // NOT Implemented GDTaskGameServerRestart GDTaskCommand = "gsrest" GDTaskGameServerInstall GDTaskCommand = "gsinst" GDTaskGameServerReinstall GDTaskCommand = "gsreinst" // NOT Implemented GDTaskGameServerUpdate GDTaskCommand = "gsupd" GDTaskGameServerDelete GDTaskCommand = "gsdel" GDTaskGameServerMove GDTaskCommand = "gsdel" GDTaskCommandExecute GDTaskCommand = "cmdexec" )
type GDTaskRepository ¶
type GDTaskStats ¶
type GDTaskStatsReader ¶
type GDTaskStatsReader interface {
Stats() GDTaskStats
}
type GDTaskStatus ¶
type GDTaskStatus string
const ( GDTaskStatusWaiting GDTaskStatus = "waiting" GDTaskStatusWorking GDTaskStatus = "working" GDTaskStatusError GDTaskStatus = "error" GDTaskStatusSuccess GDTaskStatus = "success" GDTaskStatusCanceled GDTaskStatus = "canceled" )
type Game ¶
type Game struct { Code string `json:"code"` StartCode string `json:"start_code"` Name string `json:"name"` Engine string `json:"engine"` EngineVersion string `json:"engine_version"` SteamAppSetConfig string `json:"steam_app_set_config"` RemoteRepository string `json:"remote_repository"` LocalRepository string `json:"local_repository"` SteamAppID SteamAppID `json:"steam_app_id"` }
type GameMod ¶
type GameMod struct { Name string `json:"name"` RemoteRepository string `json:"remote_repository"` LocalRepository string `json:"local_repository"` DefaultStartCMDLinux string `json:"default_start_cmd_linux"` DefaultStartCMDWindows string `json:"default_start_cmd_windows"` Vars []GameModVarTemplate `json:"vars"` ID int `json:"id"` }
type GameModVarTemplate ¶
func (*GameModVarTemplate) UnmarshalJSON ¶
func (g *GameModVarTemplate) UnmarshalJSON(bytes []byte) error
type InstallationStatus ¶
type InstallationStatus int
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func NewServer ¶
func NewServer( id int, enabled bool, installStatus InstallationStatus, blocked bool, name string, uuid string, uuidShort string, game Game, gameMod GameMod, ip string, connectPort int, queryPort int, rconPort int, rconPassword string, dir string, user string, startCommand string, stopCommand string, forceStopCommand string, restartCommand string, processActive bool, lastProcessCheck time.Time, vars map[string]string, settings Settings, updatedAt time.Time, ) *Server
func (*Server) AffectInstall ¶
func (s *Server) AffectInstall()
func (*Server) AffectStart ¶
func (s *Server) AffectStart()
func (*Server) AffectStop ¶
func (s *Server) AffectStop()
func (*Server) ConnectPort ¶
func (*Server) InstallationStatus ¶
func (s *Server) InstallationStatus() InstallationStatus
func (*Server) IsModified ¶
func (*Server) IsValueModified ¶
func (*Server) LastStatusCheck ¶
func (*Server) LastTaskCompletedAt ¶
func (*Server) NoticeTaskCompleted ¶
func (s *Server) NoticeTaskCompleted()
func (*Server) RCONPassword ¶
func (*Server) RestartCommand ¶
func (*Server) Set ¶
func (s *Server) Set( enabled bool, installStatus InstallationStatus, blocked bool, name string, uuid string, uuidShort string, game Game, gameMod GameMod, ip string, connectPort int, queryPort int, rconPort int, rconPassword string, dir string, user string, startCommand string, stopCommand string, forceStopCommand string, restartCommand string, processActive bool, lastProcessCheck time.Time, vars map[string]string, settings Settings, updatedAt time.Time, )
func (*Server) SetInstallationStatus ¶
func (s *Server) SetInstallationStatus(status InstallationStatus)
func (*Server) SetSetting ¶
func (*Server) StartCommand ¶
func (*Server) StopCommand ¶
func (*Server) UnmarkModifiedFlag ¶
func (s *Server) UnmarkModifiedFlag()
func (*Server) UpdateBeforeStart ¶
type ServerCommand ¶
type ServerCommand int
const ( Start ServerCommand = iota + 1 Pause Unpause Status Stop Kill Restart Update Install Reinstall Delete )
type ServerRepository ¶
type ServerTask ¶
type ServerTask struct {
// contains filtered or unexported fields
}
func NewServerTask ¶
func NewServerTask( id int, command ServerTaskCommand, server *Server, repeat int, repeatPeriod time.Duration, counter int, executeDate time.Time, ) *ServerTask
func (*ServerTask) CanExecute ¶
func (s *ServerTask) CanExecute() bool
func (*ServerTask) Command ¶
func (s *ServerTask) Command() ServerTaskCommand
func (*ServerTask) Counter ¶
func (s *ServerTask) Counter() int
func (*ServerTask) ExecuteDate ¶
func (s *ServerTask) ExecuteDate() time.Time
func (*ServerTask) ID ¶
func (s *ServerTask) ID() int
func (*ServerTask) IncreaseCountersAndTime ¶
func (s *ServerTask) IncreaseCountersAndTime()
func (ServerTask) MarshalJSON ¶
func (s ServerTask) MarshalJSON() ([]byte, error)
func (*ServerTask) Repeat ¶
func (s *ServerTask) Repeat() int
func (*ServerTask) RepeatEndlessly ¶
func (s *ServerTask) RepeatEndlessly() bool
func (*ServerTask) RepeatPeriod ¶
func (s *ServerTask) RepeatPeriod() time.Duration
func (*ServerTask) Server ¶
func (s *ServerTask) Server() *Server
func (*ServerTask) Status ¶
func (s *ServerTask) Status() ServerTaskStatus
type ServerTaskCommand ¶
type ServerTaskCommand string
const ( ServerTaskStart ServerTaskCommand = "start" ServerTaskStop ServerTaskCommand = "stop" ServerTaskRestart ServerTaskCommand = "restart" ServerTaskUpdate ServerTaskCommand = "update" ServerTaskReinstall ServerTaskCommand = "reinstall" )
type ServerTaskRepository ¶
type ServerTaskRepository interface { Find(ctx context.Context) ([]*ServerTask, error) Save(ctx context.Context, task *ServerTask) error Fail(ctx context.Context, task *ServerTask, output []byte) error }
type ServerTaskStatus ¶
type ServerTaskStatus int
const ( ServerTaskStatusWaiting ServerTaskStatus = iota ServerTaskStatusWorking ServerTaskStatusSuccess ServerTaskStatusFail )
type SteamAppID ¶
type SteamAppID int
func (SteamAppID) String ¶
func (appID SteamAppID) String() string
func (*SteamAppID) UnmarshalJSON ¶
func (appID *SteamAppID) UnmarshalJSON(bytes []byte) error
type SteamSettings ¶
type SteamSettings struct {
AppSetConfig string
}
Click to show internal directories.
Click to hide internal directories.