Documentation
¶
Index ¶
- func MarshalToEventData(data interface{}, output interface{})
- func ProcessDiscordEvent(url string, event *AccountIntegrationEvent) error
- func ProcessWebhookEvent(url string, event *AccountIntegrationEvent) (string, error)
- type API_AccountCreateAgent_PostData
- type AccountAudit
- type AccountIntegrationEvent
- type AccountIntegrations
- type AccountSessions
- type AccountState
- type Accounts
- func (obj *Accounts) AddAudit(auditType string, message string) error
- func (obj *Accounts) AddIntegration(newIntegration AccountIntegrations) error
- func (obj *Accounts) CreateIntegrationEvent(eventType IntegrationEventType, data interface{}) error
- func (obj *Accounts) DeleteIntegration(integrationId primitive.ObjectID) error
- func (obj *Accounts) PopulateAgents() error
- func (obj *Accounts) PopulateAudit() error
- func (obj *Accounts) PopulateFromURLQuery(populateStrings []string) error
- func (obj *Accounts) PopulateIntegrations() error
- func (obj *Accounts) PopulateSessions() error
- func (obj *Accounts) PopulateUsers() error
- func (obj *Accounts) ProcessIntegrationEvents() error
- func (obj *Accounts) UpdateIntegration(updatedIntegration AccountIntegrations) error
- type AgentBackup
- type AgentConfig
- type AgentLogs
- type AgentMapData
- type AgentMapDataBuilding
- type AgentMapDataBuilding_BoundingBox
- type AgentMapDataPlayer
- type AgentModConfig
- type AgentModConfigSelectedMod
- type AgentSave
- type AgentServerConfig
- type AgentStat
- type AgentStatus
- type AgentTask
- type Agents
- func (obj *Agents) CheckBackups(basePath string) error
- func (obj *Agents) CreateStat(running bool, cpu float64, mem float32) error
- func (obj *Agents) PopulateFromURLQuery(populateStrings []string) error
- func (obj *Agents) PopulateLogs() error
- func (obj *Agents) PopulateModConfig()
- func (obj *Agents) PopulateStats() error
- func (obj *Agents) PurgeStats() error
- func (obj *Agents) PurgeTasks() error
- type ClaimServer_PostData
- type EventData
- type EventDataAgentOffline
- type EventDataAgentOnline
- type EventDataBasic
- type IntegrationEventType
- type IntegrationType
- type ModVersion
- type ModVersionDependency
- type ModVersionTarget
- type Mods
- type User2FAState
- type UserAPIKey
- type Users
- type Vector3F
- type WorkflowAction
- func (obj *WorkflowAction) ClaimServer(workflowData API_AccountCreateAgent_PostData) error
- func (obj *WorkflowAction) CreateAgent(workflowData API_AccountCreateAgent_PostData, theAccount *Accounts) error
- func (obj *WorkflowAction) InstallSFServer(workflowData API_AccountCreateAgent_PostData) error
- func (obj *WorkflowAction) StartSFServer(workflowData API_AccountCreateAgent_PostData) error
- func (obj *WorkflowAction) WaitForInstalled(workflowData API_AccountCreateAgent_PostData) (bool, error)
- func (obj *WorkflowAction) WaitForOnline(workflowData API_AccountCreateAgent_PostData) (bool, error)
- func (obj *WorkflowAction) WaitForRunning(workflowData API_AccountCreateAgent_PostData) (bool, error)
- type Workflows
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MarshalToEventData ¶ added in v1.0.35
func MarshalToEventData(data interface{}, output interface{})
func ProcessDiscordEvent ¶ added in v1.0.35
func ProcessDiscordEvent(url string, event *AccountIntegrationEvent) error
func ProcessWebhookEvent ¶ added in v1.0.35
func ProcessWebhookEvent(url string, event *AccountIntegrationEvent) (string, error)
Types ¶
type API_AccountCreateAgent_PostData ¶ added in v1.0.42
type API_AccountCreateAgent_PostData struct {
AccountId primitive.ObjectID `json:"accountid" bson:"accountId"`
AgentName string `json:"servername" bson:"serverName"`
Port int `json:"serverPort" bson:"serverPort"`
Memory int64 `json:"serverMemory" bson:"serverMemory"`
AdminPass string `json:"serverAdminPass" bson:"serverAdminPass"`
ClientPass string `json:"serverClientPass" bson:"serverClientPass"`
APIKey string `json:"serverAPIKey" bson:"serverApiKey"`
}
type AccountAudit ¶ added in v1.0.14
type AccountIntegrationEvent ¶ added in v1.0.35
type AccountIntegrationEvent struct {
ID primitive.ObjectID `json:"_id" bson:"_id"`
Type IntegrationEventType `json:"type" bson:"type"`
Retries int `json:"retries" bson:"retries"`
Status string `json:"status" bson:"status"`
Data interface{} `json:"data" bson:"data"`
ResponseData interface{} `json:"responseData" bson:"responseData"`
Completed bool `json:"completed" bson:"completed"`
Failed bool `json:"failed" bson:"failed"`
CreatedAt time.Time `json:"createdAt" bson:"createdAt"`
UpdatedAt time.Time `json:"updatedAt" bson:"updatedAt"`
}
type AccountIntegrations ¶ added in v1.0.35
type AccountIntegrations struct {
ID primitive.ObjectID `json:"_id" bson:"_id"`
Type IntegrationType `json:"type" bson:"type"`
Url string `json:"url" bson:"url"`
EventTypes []IntegrationEventType `json:"eventTypes" bson:"eventTypes"`
Events []AccountIntegrationEvent `json:"events" bson:"events"`
CreatedAt time.Time `json:"createdAt" bson:"createdAt"`
UpdatedAt time.Time `json:"updatedAt" bson:"updatedAt"`
}
func (*AccountIntegrations) AddEvent ¶ added in v1.0.35
func (obj *AccountIntegrations) AddEvent(eventType IntegrationEventType, data interface{}) error
func (*AccountIntegrations) ProcessEvents ¶ added in v1.0.35
func (obj *AccountIntegrations) ProcessEvents() error
type AccountSessions ¶
type AccountState ¶
type Accounts ¶
type Accounts struct {
ID primitive.ObjectID `json:"_id" bson:"_id"`
AccountName string `json:"accountName" bson:"accountName"`
Sessions primitive.A `json:"-" bson:"sessions" mson:"collection=accountsessions"`
SessionObjects []AccountSessions `json:"sessions" bson:"-"`
Users primitive.A `json:"-" bson:"users" mson:"collection=users"`
UserObjects []Users `json:"users" bson:"-"`
Agents primitive.A `json:"-" bson:"agents" mson:"collection=agents"`
AgentObjects []Agents `json:"agents" bson:"-"`
Audit primitive.A `json:"-" bson:"audit" mson:"collection=accountaudit"`
AuditObjects []AccountAudit `json:"audit" bson:"-"`
State AccountState `json:"state" bson:"state"`
Integrations primitive.A `json:"-" bson:"integrations" mson:"collection=accountintegrations"`
IntegrationObjects []AccountIntegrations `json:"integrations" bson:"-"`
CreatedAt time.Time `json:"createdAt" bson:"createdAt"`
UpdatedAt time.Time `json:"updatedAt" bson:"updatedAt"`
}
func (*Accounts) AddIntegration ¶ added in v1.0.36
func (obj *Accounts) AddIntegration(newIntegration AccountIntegrations) error
func (*Accounts) CreateIntegrationEvent ¶ added in v1.0.35
func (obj *Accounts) CreateIntegrationEvent(eventType IntegrationEventType, data interface{}) error
func (*Accounts) DeleteIntegration ¶ added in v1.0.36
func (*Accounts) PopulateAgents ¶
func (*Accounts) PopulateAudit ¶ added in v1.0.14
func (*Accounts) PopulateFromURLQuery ¶ added in v1.0.35
func (*Accounts) PopulateIntegrations ¶ added in v1.0.35
func (*Accounts) PopulateSessions ¶
func (*Accounts) PopulateUsers ¶
func (*Accounts) ProcessIntegrationEvents ¶ added in v1.0.35
func (*Accounts) UpdateIntegration ¶ added in v1.0.36
func (obj *Accounts) UpdateIntegration(updatedIntegration AccountIntegrations) error
type AgentBackup ¶ added in v1.0.14
type AgentConfig ¶
type AgentConfig struct {
Version string `json:"version" bson:"version"`
Port int `json:"port" bson:"port"`
Memory int64 `json:"memory" bson:"memory"`
IP string `json:"ip" bson:"ip"`
BackupKeepAmount int `json:"backupKeepAmount" bson:"backupKeepAmount"`
BackupInterval float32 `json:"backupInterval" bson:"backupInterval"`
}
type AgentLogs ¶ added in v1.0.14
type AgentLogs struct {
ID primitive.ObjectID `json:"_id" bson:"_id"`
FileName string `json:"fileName" bson:"fileName"`
Type string `json:"type" bson:"type"`
Snippet string `json:"snippet" bson:"snippet"`
CreatedAt time.Time `json:"createdAt" bson:"createdAt"`
UpdatedAt time.Time `json:"updatedAt" bson:"updatedAt"`
}
type AgentMapData ¶
type AgentMapData struct {
Players []AgentMapDataPlayer `json:"players" bson:"players"`
Buildings []AgentMapDataBuilding `json:"buildings" bson:"buildings"`
}
type AgentMapDataBuilding ¶
type AgentMapDataBuilding struct {
Class string `json:"class" bson:"class"`
Location Vector3F `json:"location" bson:"location"`
Rotation float32 `json:"rotation" bson:"rotation"`
BoundingBox AgentMapDataBuilding_BoundingBox `json:"boundingBox" bson:"boundingBox"`
}
type AgentMapDataBuilding_BoundingBox ¶ added in v1.0.46
type AgentMapDataPlayer ¶
type AgentModConfig ¶ added in v1.0.14
type AgentModConfig struct {
LatestSMLVersion string `json:"lastestSMLVersion" bson:"lastestSMLVersion"`
InstalledSMLVersion string `json:"installedSMLVersion" bson:"installedSMLVersion"`
SelectedMods []AgentModConfigSelectedMod `json:"selectedMods" bson:"selectedMods"`
}
type AgentModConfigSelectedMod ¶ added in v1.0.14
type AgentModConfigSelectedMod struct {
Mod primitive.ObjectID `json:"-" bson:"mod" mson:"collection=mods"`
ModObject Mods `json:"mod" bson:"-"`
DesiredVersion string `json:"desiredVersion" bson:"desiredVersion"`
InstalledVersion string `json:"installedVersion" bson:"installedVersion"`
Installed bool `json:"installed" bson:"installed"`
NeedsUpdate bool `json:"needsUpdate" bson:"needsUpdate"`
Config string `json:"config" bson:"config"`
}
func (*AgentModConfigSelectedMod) PopulateMod ¶ added in v1.0.14
func (obj *AgentModConfigSelectedMod) PopulateMod()
type AgentSave ¶ added in v1.0.14
type AgentSave struct {
UUID string `json:"uuid" bson:"uuid"`
FileName string `json:"fileName" bson:"fileName"`
SessionName string `json:"sessionName" bson:"sessionName"`
Size int64 `json:"size" bson:"size"`
CreatedAt time.Time `json:"createdAt" bson:"createdAt"`
UpdatedAt time.Time `json:"updatedAt" bson:"updatedAt"`
}
type AgentServerConfig ¶
type AgentServerConfig struct {
UpdateOnStart bool `json:"updateOnStart" bson:"updateOnStart"`
Branch string `json:"branch" bson:"branch"`
WorkerThreads int `json:"workerThreads" bson:"workerThreads"`
AutoRestart bool `json:"autoRestart" bson:"autoRestart"`
// Settings for Server Ini files
MaxPlayers int `json:"maxPlayers" bson:"maxPlayers"`
AutoPause bool `json:"autoPause" bson:"autoPause"`
AutoSaveOnDisconnect bool `json:"autoSaveOnDisconnect" bson:"autoSaveOnDisconnect"`
AutoSaveInterval int `json:"autoSaveInterval" bson:"autoSaveInterval"`
DisableSeasonalEvents bool `json:"disableSeasonalEvents" bson:"disableSeasonalEvents"`
}
type AgentStatus ¶
type AgentStatus struct {
Online bool `json:"online" bson:"online"`
Running bool `json:"running" bson:"running"`
Installed bool `json:"installed" bson:"installed"`
CPU float64 `json:"cpu" bson:"cpu"`
RAM float64 `json:"ram" bson:"ram"`
LastCommDate time.Time `json:"lastCommDate" bson:"lastCommDate"`
InstalledSFVersion int64 `json:"installedSFVersion"`
LatestSFVersion int64 `json:"latestSFVersion"`
}
type AgentTask ¶ added in v1.0.14
type AgentTask struct {
ID primitive.ObjectID `json:"_id" bson:"_id"`
Action string `json:"action" bson:"action"`
Data interface{} `json:"data" bson:"data"`
Completed bool `json:"completed" bson:"completed"`
Retries int `json:"retries" bson:"retries"`
}
func NewAgentTask ¶ added in v1.0.14
type Agents ¶
type Agents struct {
ID primitive.ObjectID `json:"_id" bson:"_id"`
AgentName string `json:"agentName" bson:"agentName"`
APIKey string `json:"apiKey" bson:"apiKey"`
Status AgentStatus `json:"status" bson:"status"`
Config AgentConfig `json:"config" bson:"config"`
ServerConfig AgentServerConfig `json:"serverConfig" bson:"serverConfig"`
MapData AgentMapData `json:"mapData" bson:"mapData"`
Saves []AgentSave `json:"saves" bson:"saves"`
Backups []AgentBackup `json:"backups" bson:"backups"`
Tasks []AgentTask `json:"tasks" bson:"tasks"`
Logs primitive.A `json:"-" bson:"logs" mson:"collection=agentlogs"`
LogObjects []AgentLogs `json:"logs" bson:"-"`
Stats primitive.A `json:"-" bson:"stats" mson:"collection=agentstats"`
StatObjects []AgentStat `json:"stats" bson:"-"`
ModConfig AgentModConfig `json:"modConfig" bson:"modConfig"`
CreatedAt time.Time `json:"createdAt" bson:"createdAt"`
UpdatedAt time.Time `json:"updatedAt" bson:"updatedAt"`
}
func (*Agents) CheckBackups ¶ added in v1.0.25
func (*Agents) CreateStat ¶ added in v1.0.29
func (*Agents) PopulateFromURLQuery ¶ added in v1.0.35
func (*Agents) PopulateLogs ¶ added in v1.0.14
func (*Agents) PopulateModConfig ¶ added in v1.0.14
func (obj *Agents) PopulateModConfig()
func (*Agents) PopulateStats ¶ added in v1.0.29
func (*Agents) PurgeStats ¶ added in v1.0.29
func (*Agents) PurgeTasks ¶ added in v1.0.14
type ClaimServer_PostData ¶ added in v1.0.42
type EventDataAgentOffline ¶ added in v1.0.35
type EventDataAgentOnline ¶ added in v1.0.35
type EventDataBasic ¶ added in v1.0.35
type EventDataBasic struct {
EventData `json:"eventData"`
}
type IntegrationEventType ¶ added in v1.0.35
type IntegrationEventType int64
const ( IntegrationEventTypeAgentOnline IntegrationEventType = 0 IntegrationEventTypeAgentOffline IntegrationEventType = 1 IntegrationEventTypePlayerJoined IntegrationEventType = 2 IntegrationEventTypePlayerLeft IntegrationEventType = 3 )
type IntegrationType ¶ added in v1.0.35
type IntegrationType int64
const ( IntegrationWebhook IntegrationType = 0 IntegrationDiscord IntegrationType = 1 )
type ModVersion ¶ added in v1.0.14
type ModVersion struct {
ID string `json:"id" bson:"id"`
Version string `json:"version" bson:"version"`
CreatedAt string `json:"created_at" bson:"created_at"`
SMLVersion string `json:"sml_version" bson:"sml_version"`
Targets []ModVersionTarget `json:"targets" bson:"targets"`
Dependencies []ModVersionDependency `json:"dependencies" bson:"dependencies"`
}
type ModVersionDependency ¶ added in v1.0.14
type ModVersionTarget ¶ added in v1.0.14
type Mods ¶ added in v1.0.14
type Mods struct {
ID primitive.ObjectID `json:"_id" bson:"_id"`
ModID string `json:"id" bson:"modId"`
ModName string `json:"name" bson:"modName"`
ModReference string `json:"mod_reference" bson:"modReference"`
Hidden bool `json:"hidden" bson:"hidden"`
LogoURL string `json:"logo" bson:"logoUrl"`
Downloads int `json:"downloads" bson:"downloads"`
Versions []ModVersion `json:"versions" bson:"versions"`
}
type User2FAState ¶
type UserAPIKey ¶ added in v1.0.14
type Users ¶
type Users struct {
ID primitive.ObjectID `json:"_id" bson:"_id"`
Email string `json:"email" bson:"email"`
Password string `json:"-" bson:"password"`
IsAccountAdmin bool `json:"isAccountAdmin" bson:"isAccountAdmin"`
Active bool `json:"active" bson:"active"`
TwoFAState User2FAState `json:"twoFAState" bson:"twoFAState"`
ProfileImageURL string `json:"profileImageUrl" bson:"profileImageUrl"`
APIKeys []UserAPIKey `json:"apiKeys" bson:"apiKeys"`
InviteCode string `json:"inviteCode" bson:"inviteCode"`
LastActive time.Time `json:"lastActive" bson:"lastActive"`
CreatedAt time.Time `json:"createdAt" bson:"createdAt"`
UpdatedAt time.Time `json:"updatedAt" bson:"updatedAt"`
}
type WorkflowAction ¶ added in v1.0.42
type WorkflowAction struct {
Type string `json:"type" bson:"type"`
Status string `json:"status" bson:"status"`
ErrorMessage string `json:"error" bson:"error"`
RetryCount int `json:"retryCount" bson:"retryCount"`
}
func (*WorkflowAction) ClaimServer ¶ added in v1.0.42
func (obj *WorkflowAction) ClaimServer(workflowData API_AccountCreateAgent_PostData) error
func (*WorkflowAction) CreateAgent ¶ added in v1.0.42
func (obj *WorkflowAction) CreateAgent(workflowData API_AccountCreateAgent_PostData, theAccount *Accounts) error
func (*WorkflowAction) InstallSFServer ¶ added in v1.0.42
func (obj *WorkflowAction) InstallSFServer(workflowData API_AccountCreateAgent_PostData) error
func (*WorkflowAction) StartSFServer ¶ added in v1.0.42
func (obj *WorkflowAction) StartSFServer(workflowData API_AccountCreateAgent_PostData) error
func (*WorkflowAction) WaitForInstalled ¶ added in v1.0.42
func (obj *WorkflowAction) WaitForInstalled(workflowData API_AccountCreateAgent_PostData) (bool, error)
func (*WorkflowAction) WaitForOnline ¶ added in v1.0.42
func (obj *WorkflowAction) WaitForOnline(workflowData API_AccountCreateAgent_PostData) (bool, error)
func (*WorkflowAction) WaitForRunning ¶ added in v1.0.42
func (obj *WorkflowAction) WaitForRunning(workflowData API_AccountCreateAgent_PostData) (bool, error)
type Workflows ¶ added in v1.0.42
type Workflows struct {
ID primitive.ObjectID `json:"_id" bson:"_id"`
Type string `json:"type" bson:"type"`
Actions []WorkflowAction `json:"actions" bson:"actions"`
Status string `json:"status" bson:"status"`
Data interface{} `json:"data" bson:"data"`
}
func (*Workflows) ProcessCurrentAction ¶ added in v1.0.42
func (obj *Workflows) ProcessCurrentAction()
func (*Workflows) ValidateStatus ¶ added in v1.0.42
func (obj *Workflows) ValidateStatus()
Click to show internal directories.
Click to hide internal directories.