SCUM 停止/重启/更新以前只有“结束进程”这一条路,插件没有声明任何优雅关闭方式,
平台也没有把停止后重新启动串起来。现在插件声明自己的关闭脚本,run 先执行它,
平台在停止或更新成功后再自动拉起服务。
run:
- lifecycle stop 支持插件声明的 gracefulStop(可执行文件、参数、环境、超时、
fallback=report|terminate);关闭命令超时且声明 report 时任务失败,不再默默杀进程。
- 新增 steam.update 依赖探针:调用 steamcmd +app_info_print 获取公开分支 buildid,
与本地 steamapps/appmanifest_<appid>.acf 的 buildid 比较,输出
installed/latest/update=yes|no|unknown。
platform:
- 新增 POST /api/v1/server-instances/{id}/restart 与 /update。
- restart 派发插件 stop 动作(走优雅关闭),终态成功后入队 start 作业。
- update 派发插件 install 动作;插件在更新前必须先优雅关闭 SCUM,关闭失败直接拒绝
SteamCMD 更新,成功后平台再拉起服务。
- 依赖检查输入带上插件声明的服务器安装根目录,供 steam.update 读取 appmanifest。
plugin (SCUM server plugin 0.1.16):
- bin/scum-stop.cmd:解析已声明的可执行文件路径,定位同路径正在运行的 SCUMServer.exe,
通过本地 RCON 公告并发送关闭命令,等待进程自行退出;不再使用 taskkill。
- bin/scum-rcon.ps1:插件自有的 Source RCON 客户端,从 UE4SS mod config.ini 读取
密码/端口,密钥不离开本机。
- actions/stop.json 声明 gracefulStop;actions/install.json 更新前先执行同一关闭脚本。
platform_web:
- 服务器详情新增“重启”按钮和“SCUM 版本更新”面板;点“检查更新”查询公开分支版本,
只有检测到更新时“更新版本”按钮才会置为可用并高亮,点击后先确认再派发更新任务。
2185 lines
61 KiB
Go
2185 lines
61 KiB
Go
package domain
|
|
|
|
import "time"
|
|
|
|
type UserStatus string
|
|
|
|
const (
|
|
UserStatusActive UserStatus = "active"
|
|
UserStatusDisabled UserStatus = "disabled"
|
|
UserStatusPending UserStatus = "pending"
|
|
)
|
|
|
|
type AIProviderKind string
|
|
|
|
const (
|
|
AIProviderKindOpenAICompatible AIProviderKind = "openai-compatible"
|
|
AIProviderKindOpenAI AIProviderKind = "openai"
|
|
AIProviderKindClaude AIProviderKind = "claude"
|
|
AIProviderKindGemini AIProviderKind = "gemini"
|
|
AIProviderKindOllama AIProviderKind = "ollama"
|
|
AIProviderKindCustom AIProviderKind = "custom"
|
|
)
|
|
|
|
type AIRelayMode string
|
|
|
|
const (
|
|
AIRelayModeDirect AIRelayMode = "direct"
|
|
AIRelayModeRelay AIRelayMode = "relay"
|
|
AIRelayModeLocal AIRelayMode = "local"
|
|
)
|
|
|
|
type AIProviderStatus string
|
|
|
|
const (
|
|
AIProviderStatusActive AIProviderStatus = "active"
|
|
AIProviderStatusDisabled AIProviderStatus = "disabled"
|
|
AIProviderStatusError AIProviderStatus = "error"
|
|
)
|
|
|
|
type GamePluginStatus string
|
|
|
|
const (
|
|
GamePluginStatusInstalled GamePluginStatus = "installed"
|
|
GamePluginStatusDisabled GamePluginStatus = "disabled"
|
|
GamePluginStatusInvalid GamePluginStatus = "invalid"
|
|
GamePluginStatusUpdating GamePluginStatus = "updating"
|
|
)
|
|
|
|
type PluginMarketplaceStateAction string
|
|
|
|
const (
|
|
PluginMarketplaceStateActionInstall PluginMarketplaceStateAction = "install"
|
|
PluginMarketplaceStateActionEnable PluginMarketplaceStateAction = "enable"
|
|
PluginMarketplaceStateActionDisable PluginMarketplaceStateAction = "disable"
|
|
)
|
|
|
|
type ServerInstanceState string
|
|
|
|
const (
|
|
ServerInstanceStateDraft ServerInstanceState = "draft"
|
|
ServerInstanceStateInstalling ServerInstanceState = "installing"
|
|
ServerInstanceStateReady ServerInstanceState = "ready"
|
|
ServerInstanceStateRunning ServerInstanceState = "running"
|
|
ServerInstanceStateStopped ServerInstanceState = "stopped"
|
|
ServerInstanceStateFailed ServerInstanceState = "failed"
|
|
ServerInstanceStateDeleted ServerInstanceState = "deleted"
|
|
)
|
|
|
|
type RunEndpointStatus string
|
|
|
|
const (
|
|
RunEndpointStatusOnline RunEndpointStatus = "online"
|
|
RunEndpointStatusOffline RunEndpointStatus = "offline"
|
|
RunEndpointStatusDegraded RunEndpointStatus = "degraded"
|
|
RunEndpointStatusDisabled RunEndpointStatus = "disabled"
|
|
)
|
|
|
|
type JobState string
|
|
|
|
const (
|
|
JobStateQueued JobState = "queued"
|
|
JobStateAccepted JobState = "accepted"
|
|
JobStateRunning JobState = "running"
|
|
JobStateRetrying JobState = "retrying"
|
|
JobStateSucceeded JobState = "succeeded"
|
|
JobStateFailed JobState = "failed"
|
|
JobStateCancelled JobState = "cancelled"
|
|
)
|
|
|
|
type ArtifactOwnerKind string
|
|
|
|
const (
|
|
ArtifactOwnerKindPlatform ArtifactOwnerKind = "platform"
|
|
ArtifactOwnerKindPlugin ArtifactOwnerKind = "plugin"
|
|
ArtifactOwnerKindServerInstance ArtifactOwnerKind = "server-instance"
|
|
ArtifactOwnerKindJob ArtifactOwnerKind = "job"
|
|
)
|
|
|
|
type ArtifactState string
|
|
|
|
const (
|
|
ArtifactStateUploading ArtifactState = "uploading"
|
|
ArtifactStateAvailable ArtifactState = "available"
|
|
ArtifactStateExpired ArtifactState = "expired"
|
|
ArtifactStateFailed ArtifactState = "failed"
|
|
)
|
|
|
|
type DistributionComponentKind string
|
|
|
|
const (
|
|
DistributionComponentRun DistributionComponentKind = "run"
|
|
)
|
|
|
|
type ComponentKeyStatus string
|
|
|
|
const (
|
|
ComponentKeyStatusActive ComponentKeyStatus = "active"
|
|
ComponentKeyStatusRevoked ComponentKeyStatus = "revoked"
|
|
)
|
|
|
|
type DistributionStatus string
|
|
|
|
const (
|
|
DistributionStatusAvailable DistributionStatus = "available"
|
|
DistributionStatusRevoked DistributionStatus = "revoked"
|
|
DistributionStatusBuilding DistributionStatus = "building"
|
|
DistributionStatusFailed DistributionStatus = "failed"
|
|
)
|
|
|
|
type RuntimeBindingStatus string
|
|
|
|
const (
|
|
RuntimeBindingStatusComplete RuntimeBindingStatus = "complete"
|
|
RuntimeBindingStatusIncomplete RuntimeBindingStatus = "incomplete"
|
|
)
|
|
|
|
type DependencyState string
|
|
|
|
const (
|
|
DependencyStateUnknown DependencyState = "unknown"
|
|
DependencyStatePresent DependencyState = "present"
|
|
DependencyStateMissing DependencyState = "missing"
|
|
DependencyStateInstalling DependencyState = "installing"
|
|
DependencyStateFailed DependencyState = "failed"
|
|
)
|
|
|
|
type DistributionJobStatus string
|
|
|
|
const (
|
|
DistributionJobStatusQueued DistributionJobStatus = "queued"
|
|
DistributionJobStatusRunning DistributionJobStatus = "running"
|
|
DistributionJobStatusSucceeded DistributionJobStatus = "succeeded"
|
|
DistributionJobStatusFailed DistributionJobStatus = "failed"
|
|
DistributionJobStatusDenied DistributionJobStatus = "denied"
|
|
)
|
|
|
|
type RunUpdatePhase string
|
|
|
|
const (
|
|
RunUpdatePhaseQueued RunUpdatePhase = "queued"
|
|
RunUpdatePhaseDownloading RunUpdatePhase = "downloading"
|
|
RunUpdatePhaseStaged RunUpdatePhase = "staged"
|
|
RunUpdatePhaseRestartRequested RunUpdatePhase = "restart-requested"
|
|
RunUpdatePhaseActivating RunUpdatePhase = "activating"
|
|
RunUpdatePhaseSucceeded RunUpdatePhase = "succeeded"
|
|
RunUpdatePhaseRolledBack RunUpdatePhase = "rolled-back"
|
|
RunUpdatePhaseFailed RunUpdatePhase = "failed"
|
|
)
|
|
|
|
type LogStreamSource string
|
|
|
|
const (
|
|
LogStreamSourceProcess LogStreamSource = "process"
|
|
LogStreamSourceFile LogStreamSource = "file"
|
|
LogStreamSourcePlugin LogStreamSource = "plugin"
|
|
LogStreamSourceManagementProgram LogStreamSource = "management-program"
|
|
)
|
|
|
|
type LogStorageBackend string
|
|
|
|
const (
|
|
LogStorageBackendLocalSegments LogStorageBackend = "local-segments"
|
|
LogStorageBackendLoki LogStorageBackend = "loki"
|
|
LogStorageBackendClickHouse LogStorageBackend = "clickhouse"
|
|
LogStorageBackendOpenSearch LogStorageBackend = "opensearch"
|
|
LogStorageBackendElasticsearch LogStorageBackend = "elasticsearch"
|
|
)
|
|
|
|
type User struct {
|
|
ID string
|
|
DisplayName string
|
|
Email string
|
|
Status UserStatus
|
|
Roles []string
|
|
PasswordHash string
|
|
Profile UserProfile
|
|
Theme UserThemePreference
|
|
CreatedAt time.Time
|
|
UpdatedAt time.Time
|
|
}
|
|
|
|
type UserProfile struct {
|
|
AvatarURL string
|
|
Phone string
|
|
QQ string
|
|
ContactNote string
|
|
}
|
|
|
|
type UserThemePreference struct {
|
|
UserID string
|
|
PaletteID string
|
|
BackgroundPresetID string
|
|
BackgroundImage string
|
|
Persistence string
|
|
UpdatedAt time.Time
|
|
}
|
|
|
|
type UserRegistration struct {
|
|
DisplayName string
|
|
Email string
|
|
Password string
|
|
Profile UserProfile
|
|
}
|
|
|
|
type UserLogin struct {
|
|
Account string
|
|
Password string
|
|
}
|
|
|
|
type AuthSession struct {
|
|
SessionID string
|
|
User User
|
|
Status string
|
|
Message string
|
|
ExpiresAt time.Time
|
|
}
|
|
|
|
type AuthSessionStatus string
|
|
|
|
const (
|
|
AuthSessionStatusActive AuthSessionStatus = "active"
|
|
AuthSessionStatusRevoked AuthSessionStatus = "revoked"
|
|
)
|
|
|
|
type AuthSessionRecord struct {
|
|
ID string
|
|
UserID string
|
|
TokenHash string
|
|
Status AuthSessionStatus
|
|
Generation int
|
|
IssuedAt time.Time
|
|
ExpiresAt time.Time
|
|
LastSeenAt time.Time
|
|
RevokedAt time.Time
|
|
}
|
|
|
|
type AIProvider struct {
|
|
ID string
|
|
Name string
|
|
Kind AIProviderKind
|
|
BaseURL string
|
|
APIKeyRef string
|
|
Models []string
|
|
DefaultModel string
|
|
RelayMode AIRelayMode
|
|
TimeoutMS int
|
|
Status AIProviderStatus
|
|
RedactionPolicy string
|
|
}
|
|
|
|
type AIProviderTestResult struct {
|
|
ProviderID string
|
|
Mode string
|
|
Success bool
|
|
Message string
|
|
Violations []string
|
|
}
|
|
|
|
type AIProviderModels struct {
|
|
ProviderID string
|
|
DefaultModel string
|
|
Models []string
|
|
}
|
|
|
|
type PluginPermissions struct {
|
|
AI bool
|
|
Logs bool
|
|
Files bool
|
|
Jobs bool
|
|
Artifacts bool
|
|
RemoteAccess bool
|
|
}
|
|
|
|
type PluginLifecycleActions struct {
|
|
Install string
|
|
Start string
|
|
Stop string
|
|
Restart string
|
|
Status string
|
|
}
|
|
|
|
type GamePluginPage struct {
|
|
Key string
|
|
Title string
|
|
Path string
|
|
Bundle PluginPageBundle
|
|
Permissions []string
|
|
BridgeActions []string
|
|
FeatureKeys []string
|
|
}
|
|
|
|
// PluginPageBundle identifies an installed plugin-owned page module. The host
|
|
// validates this declaration before loading a bundle and never selects a game
|
|
// page by plugin ID.
|
|
type PluginPageBundle struct {
|
|
Key string
|
|
Version string
|
|
IntegritySHA256 string
|
|
}
|
|
|
|
// PluginFileWorkspace is a bounded, logical catalog for a plugin-owned files
|
|
// workbench. Keys are logical identifiers, never host paths.
|
|
type PluginFileWorkspace struct {
|
|
DefaultDirectoryKey string
|
|
Directories []PluginLogicalDirectory
|
|
Files []PluginLogicalFile
|
|
ConfigFields []PluginConfigField
|
|
}
|
|
|
|
type PluginLogicalDirectory struct{ Key, Label, Scope string }
|
|
type PluginLogicalFile struct {
|
|
Key, DirectoryKey, Label, Kind, StreamKey string
|
|
Editable bool
|
|
}
|
|
type PluginConfigField struct {
|
|
Key, FileKey, ConfigKey, Label, Description, Control, DefaultValue, RestartImpact string
|
|
Minimum, Maximum int
|
|
}
|
|
|
|
type GamePluginBridge struct {
|
|
Actions []string
|
|
}
|
|
|
|
// PluginCreateField is a safe, declarative game setting exposed in the
|
|
// management console during server definition creation. It deliberately
|
|
// excludes command text, host paths, secrets, and arbitrary JSON schemas.
|
|
type PluginCreateField struct {
|
|
Key string
|
|
Label string
|
|
Type string
|
|
Required bool
|
|
DefaultValue string
|
|
Options []string
|
|
ConfigKey string
|
|
}
|
|
|
|
type GamePluginManifestServer struct {
|
|
Type string
|
|
DisplayName string
|
|
SupportedOS []string
|
|
CreateFormSchema string
|
|
CreateFields []PluginCreateField
|
|
}
|
|
|
|
type GamePluginManifestAI struct {
|
|
Purposes []string
|
|
Mediation string
|
|
ConfigWritePolicy string
|
|
}
|
|
|
|
type GamePluginProductionLifecycle struct {
|
|
Operations []string
|
|
DependencyPolicy string
|
|
}
|
|
|
|
type GamePluginRemoteAccess struct {
|
|
Methods []string
|
|
RunCapabilities []string
|
|
DatabaseEngines []string
|
|
RCON bool
|
|
LogTransfer bool
|
|
}
|
|
|
|
type RuntimeTarget struct {
|
|
OS string
|
|
Arch string
|
|
}
|
|
|
|
type RuntimeDiscoveryProbe struct {
|
|
Key string
|
|
Kind string
|
|
TargetKey string
|
|
Required bool
|
|
Expected string
|
|
Platforms []string
|
|
}
|
|
|
|
type RuntimeLifecycleProfile struct {
|
|
Key string
|
|
Mode string
|
|
Capabilities []string
|
|
ActionRefs PluginLifecycleActions
|
|
TransportKeys []string
|
|
DLLExtensionRefs []string
|
|
Platforms []string
|
|
}
|
|
|
|
type RuntimeDependencyProbe struct {
|
|
Key string
|
|
Kind string
|
|
TargetKey string
|
|
Required bool
|
|
MinimumVersion string
|
|
SteamAppID string
|
|
Platforms []string
|
|
}
|
|
|
|
type RuntimeInstallStep struct {
|
|
Type string
|
|
TargetKey string
|
|
PackageManager string
|
|
PackageName string
|
|
Version string
|
|
DownloadRef string
|
|
Checksum string
|
|
}
|
|
|
|
type RuntimeInstallPlan struct {
|
|
Key string
|
|
Title string
|
|
Platforms []string
|
|
Steps []RuntimeInstallStep
|
|
}
|
|
|
|
type RuntimeLogSource struct {
|
|
Key string
|
|
Kind string
|
|
TargetKey string
|
|
StreamKey string
|
|
CursorKind string
|
|
RetentionDays int
|
|
}
|
|
|
|
type RuntimeTransportProfile struct {
|
|
Key string
|
|
Kind string
|
|
TargetKey string
|
|
Capabilities []string
|
|
}
|
|
|
|
// RuntimeDataTarget declares a bounded plugin-owned local data snapshot that
|
|
// Run may materialize before a typed query. It never carries a host path.
|
|
type RuntimeDataTarget struct {
|
|
Key string
|
|
Kind string
|
|
TransportKey string
|
|
SourceRootKey string
|
|
SourcePath string
|
|
WorkspaceKey string
|
|
RefreshPolicy string
|
|
MaxBytes int64
|
|
Platforms []string
|
|
}
|
|
|
|
type RuntimeDLLExtensionProfile struct {
|
|
Key string
|
|
DisplayName string
|
|
Kind string
|
|
Activation string
|
|
Version string
|
|
ReleaseState string
|
|
ReleaseURL string
|
|
Checksum string
|
|
SizeBytes int64
|
|
TargetKey string
|
|
ModKey string
|
|
DLLRef string
|
|
TargetExecutableChecksum string
|
|
UE4SSABI string
|
|
SupportedTargets []RuntimeTarget
|
|
UpdateOnStart bool
|
|
RCONPort int
|
|
}
|
|
|
|
type RuntimeDLLExtensionPlan struct {
|
|
Key string
|
|
Version string
|
|
ReleaseURL string
|
|
Checksum string
|
|
SizeBytes int64
|
|
TargetKey string
|
|
ModKey string
|
|
DLLRef string
|
|
TargetExecutableChecksum string
|
|
UE4SSABI string
|
|
RCONPort int
|
|
}
|
|
|
|
// RuntimeSourceRCONPlan is a frozen, secret-free loopback connection plan for
|
|
// a ready UE4SS extension. The generated local config remains Run-owned.
|
|
type RuntimeSourceRCONPlan struct {
|
|
Protocol string
|
|
ExtensionKey string
|
|
ModKey string
|
|
ConfigRef string
|
|
DeploymentStateRef string
|
|
Port int
|
|
}
|
|
|
|
type RuntimeConfigTemplate struct {
|
|
Key string
|
|
TemplateRef string
|
|
OutputRef string
|
|
}
|
|
|
|
// RuntimeServerConfigMapping maps one safe plugin create field to a logical
|
|
// game configuration key. Paths and file syntax remain Run-owned.
|
|
type RuntimeServerConfigMapping struct {
|
|
FieldKey string
|
|
ConfigKey string
|
|
ValueType string
|
|
Required bool
|
|
}
|
|
|
|
type RuntimeServerDiscoveryMarker struct {
|
|
Key string
|
|
Kind string
|
|
TargetKey string
|
|
Expected string
|
|
Required bool
|
|
}
|
|
|
|
type RuntimeServerVerificationCheck struct {
|
|
Key string
|
|
Kind string
|
|
TargetKey string
|
|
Required bool
|
|
}
|
|
|
|
// RuntimeServerPrerequisite is a plugin-declared named prerequisite resolved
|
|
// only through Run's fixed, platform-specific installer catalog.
|
|
type RuntimeServerPrerequisite struct {
|
|
Key string
|
|
Kind string
|
|
}
|
|
|
|
type GamePluginRuntimeProfiles struct {
|
|
Discovery []RuntimeDiscoveryProbe
|
|
LifecycleProfiles []RuntimeLifecycleProfile
|
|
DependencyProbes []RuntimeDependencyProbe
|
|
InstallPlans []RuntimeInstallPlan
|
|
LogSources []RuntimeLogSource
|
|
TransportProfiles []RuntimeTransportProfile
|
|
DataTargets []RuntimeDataTarget
|
|
DLLExtensions []RuntimeDLLExtensionProfile
|
|
}
|
|
|
|
type GamePluginManifest struct {
|
|
ID string
|
|
Name string
|
|
Description string
|
|
Version string
|
|
Kind string
|
|
Tags []string
|
|
Server GamePluginManifestServer
|
|
Bridge GamePluginBridge
|
|
Capabilities []string
|
|
Permissions []string
|
|
Actions PluginLifecycleActions
|
|
AssetFiles []PluginAssetFile
|
|
Pages []GamePluginPage
|
|
FileWorkspace PluginFileWorkspace
|
|
AI GamePluginManifestAI
|
|
ProductionLifecycle GamePluginProductionLifecycle
|
|
RemoteAccess GamePluginRemoteAccess
|
|
RuntimeProfiles GamePluginRuntimeProfiles
|
|
GameClientBridge GameClientBridgeManifest
|
|
}
|
|
|
|
type GamePluginManifestRegistration struct {
|
|
ManifestRef string
|
|
Manifest GamePluginManifest
|
|
AssetFiles []PluginAssetFile
|
|
}
|
|
|
|
type PluginAssetFile struct {
|
|
Path string
|
|
Content string
|
|
Encoding string
|
|
Mode int
|
|
}
|
|
|
|
type GamePlugin struct {
|
|
ID string
|
|
Name string
|
|
Description string
|
|
Version string
|
|
ServerType string
|
|
ServerDisplayName string
|
|
SupportedOS []string
|
|
ManifestRef string
|
|
CreateFormSchemaRef string
|
|
CreateFields []PluginCreateField
|
|
RequiredRunCapabilities []string
|
|
DeclaredPermissions []string
|
|
Permissions PluginPermissions
|
|
LifecycleActions PluginLifecycleActions
|
|
LifecycleAssets []PluginAssetFile
|
|
BridgeActions []string
|
|
Pages []GamePluginPage
|
|
FileWorkspace PluginFileWorkspace
|
|
Tags []string
|
|
AIPurposes []string
|
|
ProductionLifecycle GamePluginProductionLifecycle
|
|
RemoteAccess GamePluginRemoteAccess
|
|
RuntimeProfiles GamePluginRuntimeProfiles
|
|
GameClientBridge GameClientBridgeManifest
|
|
ValidationViolations []string
|
|
Status GamePluginStatus
|
|
}
|
|
|
|
type PluginMarketplacePlugin struct {
|
|
ID string
|
|
Name string
|
|
Description string
|
|
Version string
|
|
ServerType string
|
|
ServerDisplayName string
|
|
SupportedOS []string
|
|
ManifestRef string
|
|
CreateFormSchemaRef string
|
|
CreateFields []PluginCreateField
|
|
Capabilities []string
|
|
DeclaredPermissions []string
|
|
Permissions PluginPermissions
|
|
LifecycleActions PluginLifecycleActions
|
|
BridgeActions []string
|
|
Pages []GamePluginPage
|
|
Tags []string
|
|
AIPurposes []string
|
|
ProductionLifecycle GamePluginProductionLifecycle
|
|
RemoteAccess GamePluginRemoteAccess
|
|
RuntimeProfiles GamePluginRuntimeProfiles
|
|
GameClientBridge GameClientBridgeManifest
|
|
ValidationViolations []string
|
|
Status GamePluginStatus
|
|
Source string
|
|
}
|
|
|
|
type PluginBridgeAction string
|
|
|
|
const (
|
|
PluginBridgeActionServerInstancesRead PluginBridgeAction = "server.instances.read"
|
|
PluginBridgeActionJobsDispatch PluginBridgeAction = "jobs.dispatch"
|
|
PluginBridgeActionLogsQuery PluginBridgeAction = "logs.query"
|
|
PluginBridgeActionArtifactsOpen PluginBridgeAction = "artifacts.open"
|
|
PluginBridgeActionFilesRequest PluginBridgeAction = "files.request"
|
|
PluginBridgeActionRemoteAccessRequest PluginBridgeAction = "remote.access.request"
|
|
PluginBridgeActionRunDistribution PluginBridgeAction = "run.distribution.request"
|
|
PluginBridgeActionDependenciesRequest PluginBridgeAction = "dependencies.request"
|
|
PluginBridgeActionLogsBackfillRequest PluginBridgeAction = "logs.backfill.request"
|
|
PluginBridgeActionPluginLifecycle PluginBridgeAction = "plugin-lifecycle.request"
|
|
PluginBridgeActionAIInvoke PluginBridgeAction = "ai.invoke"
|
|
)
|
|
|
|
type PluginBridgeAuthorizeRequest struct {
|
|
PluginID string
|
|
RouteKey string
|
|
ServerInstanceID string
|
|
Action PluginBridgeAction
|
|
AIPurpose string
|
|
}
|
|
|
|
type PluginBridgeAuthorization struct {
|
|
PluginID string
|
|
RouteKey string
|
|
ServerInstanceID string
|
|
Action PluginBridgeAction
|
|
Allowed bool
|
|
RequiredPermissions []string
|
|
EffectivePermissions []string
|
|
Reason string
|
|
}
|
|
|
|
type PluginBridgeExecuteRequest struct {
|
|
RequestID string
|
|
PluginID string
|
|
RouteKey string
|
|
ServerInstanceID string
|
|
Action PluginBridgeAction
|
|
AIPurpose string
|
|
Payload map[string]string
|
|
}
|
|
|
|
type PluginBridgeSafeError struct {
|
|
Code string
|
|
Message string
|
|
Details []string
|
|
}
|
|
|
|
type PluginBridgeExecuteResponse struct {
|
|
RequestID string
|
|
PluginID string
|
|
RouteKey string
|
|
ServerInstanceID string
|
|
Action PluginBridgeAction
|
|
Status string
|
|
Result map[string]string
|
|
Error *PluginBridgeSafeError
|
|
}
|
|
|
|
type ServerInstance struct {
|
|
ID string
|
|
PluginID string
|
|
PluginVersion string
|
|
// DeploymentTargetID is retained only for loading legacy snapshots. New API
|
|
// flows never write or expose an operator-selected deployment target.
|
|
DeploymentTargetID string
|
|
RunEndpointID string
|
|
Name string
|
|
OwnerUserID string
|
|
AdminUserIDs []string
|
|
State ServerInstanceState
|
|
LifecycleProcessID string
|
|
LifecycleObservationSeq uint64
|
|
LifecycleObservedAt time.Time
|
|
ConfigVersion int
|
|
ConfigKey string
|
|
ConfigContent string
|
|
ConfigChecksum string
|
|
ConfigUpdatedAt time.Time
|
|
CreatedAt time.Time
|
|
UpdatedAt time.Time
|
|
// Deployment stores operator-supplied deployment inputs. Its protected path
|
|
// and command values are never included in normal platform read projections.
|
|
Deployment ServerDeploymentDefinition
|
|
DeploymentProjection ServerDeploymentProjection
|
|
}
|
|
|
|
type ServerDeploymentProjection struct {
|
|
State string
|
|
Operation string
|
|
TemplateKey string
|
|
TemplateVersion string
|
|
PreflightState string
|
|
DiscoveryState string
|
|
MappingState string
|
|
VerificationState string
|
|
DiscoveredFacts map[string]string
|
|
MappingResults map[string]string
|
|
VerificationResults map[string]string
|
|
FailureCode string
|
|
UpdatedAt time.Time
|
|
}
|
|
|
|
type ServerInstanceUpdate struct {
|
|
Name *string
|
|
}
|
|
|
|
type ServerDeletionRequest struct {
|
|
Password string
|
|
Force bool
|
|
Confirmation string
|
|
}
|
|
|
|
type PlatformResourceUsage struct {
|
|
CPUPercent float64
|
|
MemoryPercent float64
|
|
DiskPercent float64
|
|
Source string
|
|
CollectedAt time.Time
|
|
}
|
|
|
|
type ServerMetrics struct {
|
|
ServerInstanceID string
|
|
Online bool
|
|
PlayerCount *int
|
|
MaxPlayers *int
|
|
TPS *float64
|
|
LatencyMS *float64
|
|
CPUPercent *float64
|
|
MemoryPercent *float64
|
|
DiskPercent *float64
|
|
Source string
|
|
CollectedAt time.Time
|
|
}
|
|
|
|
type ServerConfig struct {
|
|
ServerInstanceID string
|
|
ConfigVersion int
|
|
Format string
|
|
Key string
|
|
Content string
|
|
Checksum string
|
|
Source string
|
|
UpdatedAt time.Time
|
|
}
|
|
|
|
// ServerDeploymentMode selects how Run prepares and launches a server.
|
|
type ServerDeploymentMode string
|
|
|
|
const (
|
|
ServerDeploymentModeGuided ServerDeploymentMode = "guided-install"
|
|
ServerDeploymentModeExisting ServerDeploymentMode = "existing-server"
|
|
ServerDeploymentModeCustom ServerDeploymentMode = "custom-command"
|
|
)
|
|
|
|
// ServerCommandShell controls deliberate shell interpretation of a command.
|
|
// Empty means Run receives the command as its default argv-compatible form.
|
|
type ServerCommandShell string
|
|
|
|
const (
|
|
ServerCommandShellNone ServerCommandShell = ""
|
|
ServerCommandShellPosix ServerCommandShell = "posix-sh"
|
|
ServerCommandShellPowerShell ServerCommandShell = "powershell"
|
|
ServerCommandShellCmd ServerCommandShell = "cmd"
|
|
)
|
|
|
|
// ServerDeploymentDefinition persists game inputs plus write-only execution
|
|
// material. It is copied into a leased Run assignment but never into DTO read
|
|
// views; callers receive ServerDeploymentView instead.
|
|
type ServerDeploymentDefinition struct {
|
|
Mode ServerDeploymentMode
|
|
ProfileKey string
|
|
RuntimeBindings map[string]string
|
|
CreateInputs map[string]string
|
|
ServerRoot string
|
|
WorkingDirectory string
|
|
InstallCommand string
|
|
StartCommand string
|
|
StopCommand string
|
|
StatusCommand string
|
|
Shell ServerCommandShell
|
|
Revision int
|
|
UpdatedAt time.Time
|
|
}
|
|
|
|
type ServerDeploymentUpdate struct {
|
|
RunEndpointID string
|
|
Mode ServerDeploymentMode
|
|
ProfileKey string
|
|
RuntimeBindings map[string]string
|
|
CreateInputs map[string]string
|
|
ServerRoot string
|
|
WorkingDirectory string
|
|
InstallCommand string
|
|
StartCommand string
|
|
StopCommand string
|
|
StatusCommand string
|
|
Shell ServerCommandShell
|
|
ShellSet bool
|
|
ClearFields []string
|
|
}
|
|
|
|
// ServerDeploymentView is the intentionally redacted read model.
|
|
type ServerDeploymentView struct {
|
|
ServerInstanceID string
|
|
Mode ServerDeploymentMode
|
|
ProfileKey string
|
|
CreateInputs map[string]string
|
|
ServerRootConfigured bool
|
|
WorkingDirectoryConfigured bool
|
|
InstallCommandConfigured bool
|
|
StartCommandConfigured bool
|
|
StopCommandConfigured bool
|
|
StatusCommandConfigured bool
|
|
Shell ServerCommandShell
|
|
Revision int
|
|
UpdatedAt time.Time
|
|
Projection ServerDeploymentProjection
|
|
LatestDispatch *ServerDeploymentDispatchEvidence
|
|
}
|
|
|
|
// ServerDeploymentReveal contains an explicitly requested operator view of
|
|
// persisted execution inputs. Runtime bindings are intentionally excluded.
|
|
type ServerDeploymentReveal struct {
|
|
ServerInstanceID string
|
|
ServerRoot string
|
|
WorkingDirectory string
|
|
InstallCommand string
|
|
StartCommand string
|
|
StopCommand string
|
|
StatusCommand string
|
|
}
|
|
|
|
// ServerDeploymentDispatchEvidence proves what Platform placed into the most
|
|
// recent lifecycle job without exposing its protected contents.
|
|
type ServerDeploymentDispatchEvidence struct {
|
|
JobID string
|
|
JobState JobState
|
|
DeploymentRevision int
|
|
DeploymentDefinitionIncluded bool
|
|
RunConfirmed bool
|
|
}
|
|
|
|
type ServerDeploymentExecutionReceipt struct {
|
|
SchemaVersion string
|
|
Revision int
|
|
Action string
|
|
Mode ServerDeploymentMode
|
|
Shell ServerCommandShell
|
|
UsedServerRoot bool
|
|
}
|
|
|
|
type ConfigDiffLine struct {
|
|
Kind string
|
|
OldNumber int
|
|
NewNumber int
|
|
Content string
|
|
}
|
|
|
|
type ServerConfigDiffRequest struct {
|
|
ServerInstanceID string
|
|
ExpectedConfigVersion int
|
|
ExpectedChecksum string
|
|
Key string
|
|
ProposedContent string
|
|
ProposedContentInputRef string
|
|
}
|
|
|
|
type ServerConfigDiffPreview struct {
|
|
ServerInstanceID string
|
|
ConfigVersion int
|
|
Checksum string
|
|
Key string
|
|
CurrentContent string
|
|
ProposedContent string
|
|
ProposedContentInputRef string
|
|
Diff []ConfigDiffLine
|
|
HasChanges bool
|
|
Source string
|
|
ReviewedAt time.Time
|
|
}
|
|
|
|
type ServerConfigWriteApproval struct {
|
|
ServerInstanceID string
|
|
ExpectedConfigVersion int
|
|
ExpectedChecksum string
|
|
Key string
|
|
ProposedContent string
|
|
ProposedContentInputRef string
|
|
IdempotencyKey string
|
|
}
|
|
|
|
type ServerConfigWriteDispatch struct {
|
|
Preview ServerConfigDiffPreview
|
|
Job Job
|
|
Status string
|
|
}
|
|
|
|
type FileOperationKind string
|
|
|
|
const (
|
|
FileOperationList FileOperationKind = "list"
|
|
FileOperationRead FileOperationKind = "read"
|
|
FileOperationWrite FileOperationKind = "write"
|
|
)
|
|
|
|
type FileOperationDispatchRequest struct {
|
|
ServerInstanceID string
|
|
PluginID string
|
|
Operation FileOperationKind
|
|
Key string
|
|
InputRef string
|
|
Content string
|
|
ExpectedConfigVersion int
|
|
ExpectedChecksum string
|
|
IdempotencyKey string
|
|
}
|
|
|
|
type FileOperationDispatchResult struct {
|
|
ServerInstanceID string
|
|
PluginID string
|
|
Operation FileOperationKind
|
|
Key string
|
|
InputRef string
|
|
Job Job
|
|
Status string
|
|
}
|
|
|
|
// DeclaredFileReadSnapshot is the redacted, bounded projection of a completed
|
|
// files.read job for one plugin-declared logical file.
|
|
type DeclaredFileReadSnapshot struct {
|
|
ServerInstanceID string
|
|
PluginID string
|
|
Key string
|
|
State string
|
|
Content string
|
|
Version int
|
|
Checksum string
|
|
SizeBytes int64
|
|
JobID string
|
|
ReadAt time.Time
|
|
Reason string
|
|
}
|
|
|
|
type ServerFileEntryKind string
|
|
|
|
const (
|
|
ServerFileEntryDirectory ServerFileEntryKind = "directory"
|
|
ServerFileEntryFile ServerFileEntryKind = "file"
|
|
)
|
|
|
|
type ServerFileTransferPolicy struct {
|
|
Channel string
|
|
UploadChunkSizeBytes int
|
|
DownloadChunkSizeBytes int
|
|
MaxInlineEditBytes int
|
|
MaxBrowserUploadBytes int64
|
|
Notes []string
|
|
}
|
|
|
|
type ServerFileWorkspaceView struct {
|
|
ServerInstanceID string
|
|
PluginID string
|
|
DefaultDirectoryKey string
|
|
Directories []PluginLogicalDirectory
|
|
Files []PluginLogicalFile
|
|
ConfigFields []PluginConfigField
|
|
Transfer ServerFileTransferPolicy
|
|
DeclaredOnly bool
|
|
RuntimeWorkspaceScope string
|
|
}
|
|
|
|
type ServerFileEntry struct {
|
|
Name string
|
|
Kind ServerFileEntryKind
|
|
DirectoryKey string
|
|
RelativePath string
|
|
LogicalKey string
|
|
Scope string
|
|
SizeBytes int64
|
|
ModifiedAt time.Time
|
|
Checksum string
|
|
Editable bool
|
|
Downloadable bool
|
|
Remark string
|
|
}
|
|
|
|
type ServerFileListRequest struct {
|
|
ServerInstanceID string
|
|
DirectoryKey string
|
|
Path string
|
|
Query string
|
|
Recursive bool
|
|
IdempotencyKey string
|
|
}
|
|
|
|
type ServerFileListResult struct {
|
|
ServerInstanceID string
|
|
PluginID string
|
|
DirectoryKey string
|
|
Path string
|
|
State string
|
|
Entries []ServerFileEntry
|
|
Job Job
|
|
RefreshedAt time.Time
|
|
Reason string
|
|
}
|
|
|
|
type ServerFileReadRequest struct {
|
|
ServerInstanceID string
|
|
PluginID string
|
|
Key string
|
|
IdempotencyKey string
|
|
}
|
|
|
|
type ServerFileWriteRequest struct {
|
|
ServerInstanceID string
|
|
PluginID string
|
|
Key string
|
|
Content string
|
|
InputRef string
|
|
ExpectedVersion int
|
|
ExpectedChecksum string
|
|
IdempotencyKey string
|
|
}
|
|
|
|
type ServerFileUploadRequest struct {
|
|
ServerInstanceID string
|
|
DirectoryKey string
|
|
RelativePath string
|
|
Filename string
|
|
Payload []byte
|
|
Checksum string
|
|
IdempotencyKey string
|
|
}
|
|
|
|
type ServerFileUploadDispatch struct {
|
|
Status string
|
|
ServerInstanceID string
|
|
DirectoryKey string
|
|
RelativePath string
|
|
ArtifactID string
|
|
InputRef string
|
|
SizeBytes int64
|
|
Checksum string
|
|
Job Job
|
|
}
|
|
|
|
type ServerFileDownloadRequest struct {
|
|
ServerInstanceID string
|
|
Key string
|
|
IdempotencyKey string
|
|
}
|
|
|
|
type ServerFileDownloadResult struct {
|
|
Status string
|
|
ServerInstanceID string
|
|
Key string
|
|
Filename string
|
|
ContentType string
|
|
Content string
|
|
Checksum string
|
|
SizeBytes int64
|
|
Artifact *ArtifactDownloadReference
|
|
Job Job
|
|
ReadAt time.Time
|
|
Reason string
|
|
}
|
|
|
|
type RunFileInputChunkRequest struct {
|
|
RunEndpointID string
|
|
SessionToken string
|
|
JobID string
|
|
LeaseToken string
|
|
Attempt int
|
|
Offset int64
|
|
Length int
|
|
}
|
|
|
|
type RunFileInputChunk struct {
|
|
JobID string
|
|
ArtifactID string
|
|
Offset int64
|
|
TotalBytes int64
|
|
Checksum string
|
|
Payload []byte
|
|
Complete bool
|
|
}
|
|
|
|
type RunCapacity struct {
|
|
MaxJobs int
|
|
RunningJobs int
|
|
QueuedJobs int
|
|
LogBacklogBatches int
|
|
ArtifactBacklogChunks int
|
|
PressureCodes []string
|
|
Summary string
|
|
}
|
|
|
|
const (
|
|
JobCapabilityConfigWrite = "config.write"
|
|
JobCapabilityFilesList = "files.list"
|
|
JobCapabilityFilesRead = "files.read"
|
|
JobCapabilityFilesWrite = "files.write"
|
|
JobCapabilityRemoteFTPRead = "remote.ftp.read"
|
|
JobCapabilityRemoteFTPWrite = "remote.ftp.write"
|
|
JobCapabilityRemoteRsyncRead = "remote.rsync.read"
|
|
JobCapabilityRemoteRsyncWrite = "remote.rsync.write"
|
|
JobCapabilityRemoteRunFilesRead = "remote.run.files.read"
|
|
JobCapabilityRemoteRunFilesWrite = "remote.run.files.write"
|
|
JobCapabilityRemoteRunProcessStart = "remote.run.process.start"
|
|
JobCapabilityRemoteRunProcessStop = "remote.run.process.stop"
|
|
JobCapabilityRemoteRunDBMySQLQuery = "remote.run.db.mysql.query"
|
|
JobCapabilityRemoteRunDBMySQLExecute = "remote.run.db.mysql.execute"
|
|
JobCapabilityRemoteRunDBSQLiteQuery = "remote.run.db.sqlite.query"
|
|
JobCapabilityRemoteRunDBSQLiteExecute = "remote.run.db.sqlite.execute"
|
|
JobCapabilityRemoteRunLogsTransfer = "remote.run.logs.transfer"
|
|
JobCapabilityRemoteRunRCONCommand = "remote.run.rcon.command"
|
|
JobCapabilityRemoteRunProgram = "remote.run.program.command"
|
|
JobCapabilityRunSelfUpdate = "run.self-update"
|
|
JobCapabilityDistributionBuild = "distribution.build"
|
|
JobCapabilityDependenciesCheck = "dependencies.check"
|
|
JobCapabilityDependenciesInstall = "dependencies.install"
|
|
JobCapabilityLogsBackfill = "logs.backfill"
|
|
// JobCapabilityDeploymentPlan gates Run implementations that understand
|
|
// protected deployment definitions, absolute paths, and custom commands.
|
|
JobCapabilityDeploymentPlan = "deployment.plan.v1"
|
|
JobCapabilityDeploymentShellPosix = "deployment.shell.posix-sh"
|
|
JobCapabilityDeploymentShellPowerShell = "deployment.shell.powershell"
|
|
JobCapabilityDeploymentShellCmd = "deployment.shell.cmd"
|
|
)
|
|
|
|
type RunEndpoint struct {
|
|
ID string
|
|
DisplayName string
|
|
Version string
|
|
Platform string
|
|
Architecture string
|
|
Status RunEndpointStatus
|
|
Capabilities []string
|
|
Capacity RunCapacity
|
|
LastHeartbeatAt time.Time
|
|
}
|
|
|
|
type JobProgress struct {
|
|
Percent int
|
|
Phase string
|
|
Message string
|
|
}
|
|
|
|
type JobRetryPolicy struct {
|
|
MaxAttempts int
|
|
InitialBackoffSeconds int
|
|
MaxBackoffSeconds int
|
|
}
|
|
|
|
type JobExecutionInput struct {
|
|
WorkspaceScope string
|
|
Content string
|
|
ExpectedVersion int
|
|
ExpectedChecksum string
|
|
MaxReadBytes int
|
|
RemoteAdapterKey string
|
|
RemoteAdapterKind string
|
|
TimeoutSeconds int
|
|
PluginID string
|
|
LifecycleOperation string
|
|
TargetVersion string
|
|
Inputs map[string]string
|
|
LogSource *RuntimeLogSource
|
|
LogSources []RuntimeLogSource
|
|
DLLExtensions []RuntimeDLLExtensionPlan
|
|
SourceRCON *RuntimeSourceRCONPlan
|
|
Deployment *ServerDeploymentDefinition
|
|
ServerDeploymentPlan *ServerDeploymentPlan
|
|
}
|
|
|
|
type ServerDeploymentPlan struct {
|
|
SchemaVersion string
|
|
Operation string
|
|
PluginID string
|
|
TemplateKey string
|
|
TemplateVersion string
|
|
SteamAppID string
|
|
ExecutableKey string
|
|
InstallRootKey string
|
|
ConfigKey string
|
|
ConfigFormat string
|
|
Prerequisites []RuntimeServerPrerequisite
|
|
ConfigMappings []RuntimeServerConfigMapping
|
|
DiscoveryMarkers []RuntimeServerDiscoveryMarker
|
|
VerificationChecks []RuntimeServerVerificationCheck
|
|
}
|
|
|
|
type ServerDeploymentEvidence struct {
|
|
TemplateKey string
|
|
TemplateVersion string
|
|
PreflightState string
|
|
DiscoveryState string
|
|
MappingState string
|
|
VerificationState string
|
|
DiscoveredFacts map[string]string
|
|
MappingResults map[string]string
|
|
VerificationResults map[string]string
|
|
FailureCode string
|
|
}
|
|
|
|
type JobExecutionResult struct {
|
|
Kind string
|
|
ProcessState string
|
|
ExitClassification string
|
|
ExitCode int
|
|
Version int
|
|
Checksum string
|
|
SizeBytes int64
|
|
Summary string
|
|
Content string
|
|
ServerDeploymentEvidence *ServerDeploymentEvidence
|
|
DeploymentReceipt *ServerDeploymentExecutionReceipt
|
|
}
|
|
|
|
type Job struct {
|
|
ID string
|
|
ServerInstanceID string
|
|
RunEndpointID string
|
|
Capability string
|
|
TargetKey string
|
|
InputRef string
|
|
IdempotencyKey string
|
|
State JobState
|
|
Progress JobProgress
|
|
ResultRef string
|
|
ExecutionInput JobExecutionInput
|
|
ExecutionResult JobExecutionResult
|
|
RetryPolicy JobRetryPolicy
|
|
Attempt int
|
|
QueueEligibleAt time.Time
|
|
NextAttemptAt time.Time
|
|
LeaseTokenHash string
|
|
LeaseSessionGen int
|
|
AckDeadlineAt time.Time
|
|
LeaseExpiresAt time.Time
|
|
LastProgressSeq uint64
|
|
CancelReason string
|
|
CancelRequestedAt time.Time
|
|
CancelCompletedAt time.Time
|
|
TerminalAt time.Time
|
|
TerminalFingerprint string
|
|
LastReconciledAt time.Time
|
|
ReconcileCount int
|
|
ReconcileOutcome string
|
|
CreatedAt time.Time
|
|
UpdatedAt time.Time
|
|
}
|
|
|
|
type Artifact struct {
|
|
ID string
|
|
OwnerKind ArtifactOwnerKind
|
|
OwnerID string
|
|
SizeBytes int64
|
|
Checksum string
|
|
State ArtifactState
|
|
CreatedAt time.Time
|
|
UpdatedAt time.Time
|
|
}
|
|
|
|
type RuntimeBinding struct {
|
|
ID string
|
|
ServerInstanceID string
|
|
PluginID string
|
|
PluginVersion string
|
|
ProfileKey string
|
|
Mode string
|
|
Bindings map[string]string
|
|
MissingKeys []string
|
|
Status RuntimeBindingStatus
|
|
CreatedAt time.Time
|
|
UpdatedAt time.Time
|
|
}
|
|
|
|
type RuntimeBindingUpdate struct {
|
|
ProfileKey string
|
|
Bindings map[string]string
|
|
}
|
|
|
|
type RuntimeBindingKeyView struct {
|
|
Key string
|
|
Required bool
|
|
Configured bool
|
|
Secret bool
|
|
}
|
|
|
|
type RuntimeBindingView struct {
|
|
ServerInstanceID string
|
|
PluginID string
|
|
ProfileKey string
|
|
Mode string
|
|
Configured bool
|
|
Keys []RuntimeBindingKeyView
|
|
MissingKeys []string
|
|
Status RuntimeBindingStatus
|
|
Reason string
|
|
CreatedAt time.Time
|
|
UpdatedAt time.Time
|
|
}
|
|
|
|
type EncryptedComponentKey struct {
|
|
ID string
|
|
ServerInstanceID string
|
|
ComponentKind DistributionComponentKind
|
|
ComponentKey string
|
|
EncryptedKey string
|
|
KeyHash string
|
|
Fingerprint string
|
|
SecretRef string
|
|
Generation int
|
|
Status ComponentKeyStatus
|
|
CreatedAt time.Time
|
|
UpdatedAt time.Time
|
|
ResetAt time.Time
|
|
}
|
|
|
|
type RunDistribution struct {
|
|
ID string
|
|
ServerInstanceID string
|
|
PluginID string
|
|
RunEndpointID string
|
|
TargetOS string
|
|
TargetArch string
|
|
PackageFormat string
|
|
BuildJobID string
|
|
ArtifactID string
|
|
Checksum string
|
|
KeyGeneration int
|
|
SecretRef string
|
|
Status DistributionStatus
|
|
CreatedAt time.Time
|
|
UpdatedAt time.Time
|
|
}
|
|
|
|
type DependencyStatus struct {
|
|
ID string
|
|
ServerInstanceID string
|
|
PluginID string
|
|
ProbeKey string
|
|
TargetOS string
|
|
TargetArch string
|
|
State DependencyState
|
|
Required bool
|
|
InstallPlanKey string
|
|
PlanDigest string
|
|
JobID string
|
|
Evidence string
|
|
CompletedSteps int
|
|
Message string
|
|
CheckedAt time.Time
|
|
UpdatedAt time.Time
|
|
}
|
|
|
|
type RunUpdateJob struct {
|
|
ID string
|
|
ServerInstanceID string
|
|
RunEndpointID string
|
|
ArtifactID string
|
|
Checksum string
|
|
TargetOS string
|
|
TargetArch string
|
|
TargetRelease string
|
|
PreviousVersion string
|
|
JobID string
|
|
IdempotencyKey string
|
|
Status DistributionJobStatus
|
|
Phase RunUpdatePhase
|
|
Message string
|
|
Rollback bool
|
|
CreatedAt time.Time
|
|
UpdatedAt time.Time
|
|
}
|
|
|
|
type RunDistributionGenerateRequest struct {
|
|
ServerInstanceID string
|
|
TargetOS string
|
|
TargetArch string
|
|
IdempotencyKey string
|
|
}
|
|
|
|
type ComponentKeyResetRequest struct {
|
|
ServerInstanceID string
|
|
ComponentKind DistributionComponentKind
|
|
ComponentKey string
|
|
}
|
|
|
|
type ComponentAuthenticationRequest struct {
|
|
ServerInstanceID string
|
|
ComponentKind DistributionComponentKind
|
|
ComponentKey string
|
|
Generation int
|
|
Key string
|
|
}
|
|
|
|
type ComponentAuthenticationResult struct {
|
|
ServerInstanceID string
|
|
ComponentKind DistributionComponentKind
|
|
ComponentKey string
|
|
Generation int
|
|
Allowed bool
|
|
Reason string
|
|
}
|
|
|
|
type ServerRuntimeAction struct {
|
|
Key string
|
|
Label string
|
|
Available bool
|
|
Reason string
|
|
}
|
|
|
|
type ServerRuntimeActions struct {
|
|
ServerInstanceID string
|
|
PluginID string
|
|
RunEndpointID string
|
|
RunStatus RunEndpointStatus
|
|
Actions []ServerRuntimeAction
|
|
}
|
|
|
|
type RunUpdateRequest struct {
|
|
ServerInstanceID string
|
|
ArtifactID string
|
|
Checksum string
|
|
IdempotencyKey string
|
|
}
|
|
|
|
type DependencyJobRequest struct {
|
|
ServerInstanceID string
|
|
ProbeKey string
|
|
InstallPlanKey string
|
|
PlanDigest string
|
|
TargetOS string
|
|
TargetArch string
|
|
IdempotencyKey string
|
|
Install bool
|
|
}
|
|
|
|
type DependencyProbeView struct {
|
|
Key string
|
|
Kind string
|
|
Required bool
|
|
MinimumVersion string
|
|
State DependencyState
|
|
Evidence string
|
|
InstallPlanKey string
|
|
}
|
|
|
|
type DependencyPlanStepView struct {
|
|
Type string
|
|
TargetKey string
|
|
PackageManager string
|
|
PackageName string
|
|
Version string
|
|
DownloadHost string
|
|
SizeBytes int64
|
|
}
|
|
|
|
type DependencyPlanView struct {
|
|
Key string
|
|
Title string
|
|
TargetOS string
|
|
TargetArch string
|
|
Digest string
|
|
Steps []DependencyPlanStepView
|
|
}
|
|
|
|
type DependencyCatalog struct {
|
|
ServerInstanceID string
|
|
PluginID string
|
|
PluginVersion string
|
|
ProfileKey string
|
|
TargetOS string
|
|
TargetArch string
|
|
Probes []DependencyProbeView
|
|
Plans []DependencyPlanView
|
|
UpdatedAt time.Time
|
|
}
|
|
|
|
type LogBackfillRequest struct {
|
|
ServerInstanceID string
|
|
SourceKey string
|
|
CheckpointRef string
|
|
IdempotencyKey string
|
|
Limit int
|
|
}
|
|
|
|
type LogStream struct {
|
|
ID string
|
|
ServerInstanceID string
|
|
Source LogStreamSource
|
|
StreamKey string
|
|
LogSessionID string
|
|
SessionStartedAt time.Time
|
|
LatestSeq uint64
|
|
StorageBackend LogStorageBackend
|
|
RetentionPolicy string
|
|
CreatedAt time.Time
|
|
UpdatedAt time.Time
|
|
}
|
|
|
|
type UserFilter struct {
|
|
Status UserStatus
|
|
}
|
|
|
|
type AuthSessionFilter struct {
|
|
UserID string
|
|
TokenHash string
|
|
Status AuthSessionStatus
|
|
}
|
|
|
|
type AIProviderFilter struct {
|
|
Kind AIProviderKind
|
|
Status AIProviderStatus
|
|
}
|
|
|
|
type GamePluginFilter struct {
|
|
ServerType string
|
|
Status GamePluginStatus
|
|
}
|
|
|
|
type PluginMarketplaceFilter struct {
|
|
ServerType string
|
|
Status GamePluginStatus
|
|
Capability string
|
|
Keyword string
|
|
}
|
|
|
|
type ServerInstanceFilter struct {
|
|
PluginID string
|
|
RunEndpointID string
|
|
State ServerInstanceState
|
|
VisibleToUserID string
|
|
}
|
|
|
|
type RunEndpointFilter struct {
|
|
Status RunEndpointStatus
|
|
}
|
|
|
|
type JobFilter struct {
|
|
ServerInstanceID string
|
|
RunEndpointID string
|
|
State JobState
|
|
States []JobState
|
|
Limit int
|
|
}
|
|
|
|
type ArtifactFilter struct {
|
|
OwnerKind ArtifactOwnerKind
|
|
OwnerID string
|
|
State ArtifactState
|
|
}
|
|
|
|
type RuntimeBindingFilter struct {
|
|
ServerInstanceID string
|
|
ProfileKey string
|
|
Status RuntimeBindingStatus
|
|
}
|
|
|
|
type EncryptedComponentKeyFilter struct {
|
|
ServerInstanceID string
|
|
ComponentKind DistributionComponentKind
|
|
ComponentKey string
|
|
Status ComponentKeyStatus
|
|
}
|
|
|
|
type RunDistributionFilter struct {
|
|
ServerInstanceID string
|
|
TargetOS string
|
|
TargetArch string
|
|
Status DistributionStatus
|
|
}
|
|
|
|
type DependencyStatusFilter struct {
|
|
ServerInstanceID string
|
|
ProbeKey string
|
|
State DependencyState
|
|
}
|
|
|
|
type RunUpdateJobFilter struct {
|
|
ServerInstanceID string
|
|
Status DistributionJobStatus
|
|
}
|
|
|
|
type LogStreamFilter struct {
|
|
ServerInstanceID string
|
|
StreamKey string
|
|
}
|
|
|
|
func CopyStringSlice(values []string) []string {
|
|
if values == nil {
|
|
return nil
|
|
}
|
|
out := make([]string, len(values))
|
|
copy(out, values)
|
|
return out
|
|
}
|
|
|
|
func CopyStringMap(values map[string]string) map[string]string {
|
|
if values == nil {
|
|
return nil
|
|
}
|
|
out := make(map[string]string, len(values))
|
|
for key, value := range values {
|
|
out[key] = value
|
|
}
|
|
return out
|
|
}
|
|
|
|
func CopyUser(user User) User {
|
|
user.Roles = CopyStringSlice(user.Roles)
|
|
return user
|
|
}
|
|
|
|
func CopyAuthSessionRecord(session AuthSessionRecord) AuthSessionRecord {
|
|
return session
|
|
}
|
|
|
|
func CopyAIProvider(provider AIProvider) AIProvider {
|
|
provider.Models = CopyStringSlice(provider.Models)
|
|
return provider
|
|
}
|
|
|
|
func CopyAIProviderTestResult(result AIProviderTestResult) AIProviderTestResult {
|
|
result.Violations = CopyStringSlice(result.Violations)
|
|
return result
|
|
}
|
|
|
|
func CopyAIProviderModels(models AIProviderModels) AIProviderModels {
|
|
models.Models = CopyStringSlice(models.Models)
|
|
return models
|
|
}
|
|
|
|
func CopyGamePlugin(plugin GamePlugin) GamePlugin {
|
|
plugin.RequiredRunCapabilities = CopyStringSlice(plugin.RequiredRunCapabilities)
|
|
plugin.DeclaredPermissions = CopyStringSlice(plugin.DeclaredPermissions)
|
|
plugin.SupportedOS = CopyStringSlice(plugin.SupportedOS)
|
|
plugin.CreateFields = CopyPluginCreateFields(plugin.CreateFields)
|
|
plugin.LifecycleAssets = CopyPluginAssetFiles(plugin.LifecycleAssets)
|
|
plugin.BridgeActions = CopyStringSlice(plugin.BridgeActions)
|
|
plugin.Pages = CopyGamePluginPageSlice(plugin.Pages)
|
|
plugin.FileWorkspace = CopyPluginFileWorkspace(plugin.FileWorkspace)
|
|
plugin.Tags = CopyStringSlice(plugin.Tags)
|
|
plugin.AIPurposes = CopyStringSlice(plugin.AIPurposes)
|
|
plugin.ProductionLifecycle = CopyGamePluginProductionLifecycle(plugin.ProductionLifecycle)
|
|
plugin.RemoteAccess = CopyGamePluginRemoteAccess(plugin.RemoteAccess)
|
|
plugin.RuntimeProfiles = CopyGamePluginRuntimeProfiles(plugin.RuntimeProfiles)
|
|
plugin.GameClientBridge = CopyGameClientBridgeManifest(plugin.GameClientBridge)
|
|
plugin.ValidationViolations = CopyStringSlice(plugin.ValidationViolations)
|
|
return plugin
|
|
}
|
|
|
|
func CopyPluginMarketplacePlugin(plugin PluginMarketplacePlugin) PluginMarketplacePlugin {
|
|
plugin.SupportedOS = CopyStringSlice(plugin.SupportedOS)
|
|
plugin.Capabilities = CopyStringSlice(plugin.Capabilities)
|
|
plugin.CreateFields = CopyPluginCreateFields(plugin.CreateFields)
|
|
plugin.DeclaredPermissions = CopyStringSlice(plugin.DeclaredPermissions)
|
|
plugin.BridgeActions = CopyStringSlice(plugin.BridgeActions)
|
|
plugin.Pages = CopyGamePluginPageSlice(plugin.Pages)
|
|
plugin.Tags = CopyStringSlice(plugin.Tags)
|
|
plugin.AIPurposes = CopyStringSlice(plugin.AIPurposes)
|
|
plugin.ProductionLifecycle = CopyGamePluginProductionLifecycle(plugin.ProductionLifecycle)
|
|
plugin.RemoteAccess = CopyGamePluginRemoteAccess(plugin.RemoteAccess)
|
|
plugin.RuntimeProfiles = CopyGamePluginRuntimeProfiles(plugin.RuntimeProfiles)
|
|
plugin.GameClientBridge = CopyGameClientBridgeManifest(plugin.GameClientBridge)
|
|
plugin.ValidationViolations = CopyStringSlice(plugin.ValidationViolations)
|
|
return plugin
|
|
}
|
|
|
|
func CopyPluginMarketplacePluginSlice(plugins []PluginMarketplacePlugin) []PluginMarketplacePlugin {
|
|
if plugins == nil {
|
|
return nil
|
|
}
|
|
out := make([]PluginMarketplacePlugin, len(plugins))
|
|
for i, plugin := range plugins {
|
|
out[i] = CopyPluginMarketplacePlugin(plugin)
|
|
}
|
|
return out
|
|
}
|
|
|
|
func CopyGamePluginManifestRegistration(registration GamePluginManifestRegistration) GamePluginManifestRegistration {
|
|
registration.Manifest = CopyGamePluginManifest(registration.Manifest)
|
|
registration.AssetFiles = CopyPluginAssetFiles(registration.AssetFiles)
|
|
return registration
|
|
}
|
|
|
|
func CopyPluginAssetFiles(files []PluginAssetFile) []PluginAssetFile {
|
|
if files == nil {
|
|
return nil
|
|
}
|
|
out := make([]PluginAssetFile, len(files))
|
|
copy(out, files)
|
|
return out
|
|
}
|
|
|
|
func CopyGamePluginManifest(manifest GamePluginManifest) GamePluginManifest {
|
|
manifest.Tags = CopyStringSlice(manifest.Tags)
|
|
manifest.Server.SupportedOS = CopyStringSlice(manifest.Server.SupportedOS)
|
|
manifest.Server.CreateFields = CopyPluginCreateFields(manifest.Server.CreateFields)
|
|
manifest.Bridge.Actions = CopyStringSlice(manifest.Bridge.Actions)
|
|
manifest.Capabilities = CopyStringSlice(manifest.Capabilities)
|
|
manifest.Permissions = CopyStringSlice(manifest.Permissions)
|
|
manifest.AssetFiles = CopyPluginAssetFiles(manifest.AssetFiles)
|
|
manifest.Pages = CopyGamePluginPageSlice(manifest.Pages)
|
|
manifest.FileWorkspace = CopyPluginFileWorkspace(manifest.FileWorkspace)
|
|
manifest.AI.Purposes = CopyStringSlice(manifest.AI.Purposes)
|
|
manifest.ProductionLifecycle = CopyGamePluginProductionLifecycle(manifest.ProductionLifecycle)
|
|
manifest.RemoteAccess = CopyGamePluginRemoteAccess(manifest.RemoteAccess)
|
|
manifest.RuntimeProfiles = CopyGamePluginRuntimeProfiles(manifest.RuntimeProfiles)
|
|
manifest.GameClientBridge = CopyGameClientBridgeManifest(manifest.GameClientBridge)
|
|
return manifest
|
|
}
|
|
|
|
func CopyPluginFileWorkspace(workspace PluginFileWorkspace) PluginFileWorkspace {
|
|
workspace.Directories = append([]PluginLogicalDirectory(nil), workspace.Directories...)
|
|
workspace.Files = append([]PluginLogicalFile(nil), workspace.Files...)
|
|
workspace.ConfigFields = append([]PluginConfigField(nil), workspace.ConfigFields...)
|
|
return workspace
|
|
}
|
|
|
|
func CopyPluginCreateFields(fields []PluginCreateField) []PluginCreateField {
|
|
if fields == nil {
|
|
return nil
|
|
}
|
|
copy := append([]PluginCreateField(nil), fields...)
|
|
for i := range copy {
|
|
copy[i].Options = CopyStringSlice(copy[i].Options)
|
|
}
|
|
return copy
|
|
}
|
|
|
|
func CopyGamePluginProductionLifecycle(lifecycle GamePluginProductionLifecycle) GamePluginProductionLifecycle {
|
|
lifecycle.Operations = CopyStringSlice(lifecycle.Operations)
|
|
return lifecycle
|
|
}
|
|
|
|
func CopyGamePluginRuntimeProfiles(profiles GamePluginRuntimeProfiles) GamePluginRuntimeProfiles {
|
|
profiles.Discovery = append([]RuntimeDiscoveryProbe(nil), profiles.Discovery...)
|
|
for i := range profiles.Discovery {
|
|
profiles.Discovery[i].Platforms = CopyStringSlice(profiles.Discovery[i].Platforms)
|
|
}
|
|
profiles.LifecycleProfiles = append([]RuntimeLifecycleProfile(nil), profiles.LifecycleProfiles...)
|
|
for i := range profiles.LifecycleProfiles {
|
|
profiles.LifecycleProfiles[i].Capabilities = CopyStringSlice(profiles.LifecycleProfiles[i].Capabilities)
|
|
profiles.LifecycleProfiles[i].TransportKeys = CopyStringSlice(profiles.LifecycleProfiles[i].TransportKeys)
|
|
profiles.LifecycleProfiles[i].DLLExtensionRefs = CopyStringSlice(profiles.LifecycleProfiles[i].DLLExtensionRefs)
|
|
profiles.LifecycleProfiles[i].Platforms = CopyStringSlice(profiles.LifecycleProfiles[i].Platforms)
|
|
}
|
|
profiles.DependencyProbes = append([]RuntimeDependencyProbe(nil), profiles.DependencyProbes...)
|
|
for i := range profiles.DependencyProbes {
|
|
profiles.DependencyProbes[i].Platforms = CopyStringSlice(profiles.DependencyProbes[i].Platforms)
|
|
}
|
|
profiles.InstallPlans = append([]RuntimeInstallPlan(nil), profiles.InstallPlans...)
|
|
for i := range profiles.InstallPlans {
|
|
profiles.InstallPlans[i].Platforms = CopyStringSlice(profiles.InstallPlans[i].Platforms)
|
|
profiles.InstallPlans[i].Steps = append([]RuntimeInstallStep(nil), profiles.InstallPlans[i].Steps...)
|
|
}
|
|
profiles.LogSources = append([]RuntimeLogSource(nil), profiles.LogSources...)
|
|
profiles.TransportProfiles = append([]RuntimeTransportProfile(nil), profiles.TransportProfiles...)
|
|
for i := range profiles.TransportProfiles {
|
|
profiles.TransportProfiles[i].Capabilities = CopyStringSlice(profiles.TransportProfiles[i].Capabilities)
|
|
}
|
|
profiles.DataTargets = append([]RuntimeDataTarget(nil), profiles.DataTargets...)
|
|
for i := range profiles.DataTargets {
|
|
profiles.DataTargets[i].Platforms = CopyStringSlice(profiles.DataTargets[i].Platforms)
|
|
}
|
|
profiles.DLLExtensions = append([]RuntimeDLLExtensionProfile(nil), profiles.DLLExtensions...)
|
|
for i := range profiles.DLLExtensions {
|
|
profiles.DLLExtensions[i].SupportedTargets = append([]RuntimeTarget(nil), profiles.DLLExtensions[i].SupportedTargets...)
|
|
}
|
|
return profiles
|
|
}
|
|
|
|
func CopyGamePluginRemoteAccess(remote GamePluginRemoteAccess) GamePluginRemoteAccess {
|
|
remote.Methods = CopyStringSlice(remote.Methods)
|
|
remote.RunCapabilities = CopyStringSlice(remote.RunCapabilities)
|
|
remote.DatabaseEngines = CopyStringSlice(remote.DatabaseEngines)
|
|
return remote
|
|
}
|
|
|
|
func CopyGamePluginPageSlice(pages []GamePluginPage) []GamePluginPage {
|
|
if pages == nil {
|
|
return nil
|
|
}
|
|
out := make([]GamePluginPage, len(pages))
|
|
for i, page := range pages {
|
|
out[i] = page
|
|
out[i].Permissions = CopyStringSlice(page.Permissions)
|
|
out[i].BridgeActions = CopyStringSlice(page.BridgeActions)
|
|
out[i].FeatureKeys = CopyStringSlice(page.FeatureKeys)
|
|
}
|
|
return out
|
|
}
|
|
|
|
func CopyPluginBridgeAuthorization(result PluginBridgeAuthorization) PluginBridgeAuthorization {
|
|
result.RequiredPermissions = CopyStringSlice(result.RequiredPermissions)
|
|
result.EffectivePermissions = CopyStringSlice(result.EffectivePermissions)
|
|
return result
|
|
}
|
|
|
|
func CopyPluginBridgeExecuteRequest(request PluginBridgeExecuteRequest) PluginBridgeExecuteRequest {
|
|
request.Payload = CopyStringMap(request.Payload)
|
|
return request
|
|
}
|
|
|
|
func CopyPluginBridgeExecuteResponse(response PluginBridgeExecuteResponse) PluginBridgeExecuteResponse {
|
|
response.Result = CopyStringMap(response.Result)
|
|
if response.Error != nil {
|
|
errorCopy := *response.Error
|
|
errorCopy.Details = CopyStringSlice(errorCopy.Details)
|
|
response.Error = &errorCopy
|
|
}
|
|
return response
|
|
}
|
|
|
|
func CopyServerInstance(instance ServerInstance) ServerInstance {
|
|
instance.AdminUserIDs = CopyStringSlice(instance.AdminUserIDs)
|
|
instance.Deployment = CopyServerDeploymentDefinition(instance.Deployment)
|
|
instance.DeploymentProjection = CopyServerDeploymentProjection(instance.DeploymentProjection)
|
|
return instance
|
|
}
|
|
|
|
func CopyServerDeploymentProjection(projection ServerDeploymentProjection) ServerDeploymentProjection {
|
|
projection.DiscoveredFacts = CopyStringMap(projection.DiscoveredFacts)
|
|
projection.MappingResults = CopyStringMap(projection.MappingResults)
|
|
projection.VerificationResults = CopyStringMap(projection.VerificationResults)
|
|
return projection
|
|
}
|
|
|
|
func CopyServerDeploymentPlan(plan *ServerDeploymentPlan) *ServerDeploymentPlan {
|
|
if plan == nil {
|
|
return nil
|
|
}
|
|
copy := *plan
|
|
copy.Prerequisites = append([]RuntimeServerPrerequisite(nil), plan.Prerequisites...)
|
|
copy.ConfigMappings = append([]RuntimeServerConfigMapping(nil), plan.ConfigMappings...)
|
|
copy.DiscoveryMarkers = append([]RuntimeServerDiscoveryMarker(nil), plan.DiscoveryMarkers...)
|
|
copy.VerificationChecks = append([]RuntimeServerVerificationCheck(nil), plan.VerificationChecks...)
|
|
return ©
|
|
}
|
|
|
|
func CopyServerDeploymentEvidence(evidence *ServerDeploymentEvidence) *ServerDeploymentEvidence {
|
|
if evidence == nil {
|
|
return nil
|
|
}
|
|
copy := *evidence
|
|
copy.DiscoveredFacts = CopyStringMap(evidence.DiscoveredFacts)
|
|
copy.MappingResults = CopyStringMap(evidence.MappingResults)
|
|
copy.VerificationResults = CopyStringMap(evidence.VerificationResults)
|
|
return ©
|
|
}
|
|
|
|
func CopyServerDeploymentExecutionReceipt(receipt *ServerDeploymentExecutionReceipt) *ServerDeploymentExecutionReceipt {
|
|
if receipt == nil {
|
|
return nil
|
|
}
|
|
copy := *receipt
|
|
return ©
|
|
}
|
|
|
|
func CopyServerDeploymentDefinition(definition ServerDeploymentDefinition) ServerDeploymentDefinition {
|
|
definition.RuntimeBindings = CopyStringMap(definition.RuntimeBindings)
|
|
definition.CreateInputs = CopyStringMap(definition.CreateInputs)
|
|
return definition
|
|
}
|
|
|
|
func CopyServerDeploymentUpdate(update ServerDeploymentUpdate) ServerDeploymentUpdate {
|
|
update.ClearFields = CopyStringSlice(update.ClearFields)
|
|
update.RuntimeBindings = CopyStringMap(update.RuntimeBindings)
|
|
update.CreateInputs = CopyStringMap(update.CreateInputs)
|
|
return update
|
|
}
|
|
|
|
func CopyServerDeploymentView(view ServerDeploymentView) ServerDeploymentView {
|
|
view.CreateInputs = CopyStringMap(view.CreateInputs)
|
|
if view.LatestDispatch != nil {
|
|
copy := *view.LatestDispatch
|
|
view.LatestDispatch = ©
|
|
}
|
|
return view
|
|
}
|
|
|
|
func CopyPlatformResourceUsage(usage PlatformResourceUsage) PlatformResourceUsage {
|
|
return usage
|
|
}
|
|
|
|
func CopyServerMetrics(metrics ServerMetrics) ServerMetrics {
|
|
return metrics
|
|
}
|
|
|
|
func CopyServerMetricsSlice(items []ServerMetrics) []ServerMetrics {
|
|
if items == nil {
|
|
return nil
|
|
}
|
|
out := make([]ServerMetrics, len(items))
|
|
copy(out, items)
|
|
return out
|
|
}
|
|
|
|
func CopyServerConfig(config ServerConfig) ServerConfig {
|
|
return config
|
|
}
|
|
|
|
func CopyConfigDiffLines(lines []ConfigDiffLine) []ConfigDiffLine {
|
|
if lines == nil {
|
|
return nil
|
|
}
|
|
out := make([]ConfigDiffLine, len(lines))
|
|
copy(out, lines)
|
|
return out
|
|
}
|
|
|
|
func CopyServerConfigDiffPreview(preview ServerConfigDiffPreview) ServerConfigDiffPreview {
|
|
preview.Diff = CopyConfigDiffLines(preview.Diff)
|
|
return preview
|
|
}
|
|
|
|
func CopyServerConfigWriteDispatch(dispatch ServerConfigWriteDispatch) ServerConfigWriteDispatch {
|
|
dispatch.Preview = CopyServerConfigDiffPreview(dispatch.Preview)
|
|
dispatch.Job = CopyJob(dispatch.Job)
|
|
return dispatch
|
|
}
|
|
|
|
func CopyFileOperationDispatchResult(result FileOperationDispatchResult) FileOperationDispatchResult {
|
|
result.Job = CopyJob(result.Job)
|
|
return result
|
|
}
|
|
|
|
func CopyServerFileTransferPolicy(policy ServerFileTransferPolicy) ServerFileTransferPolicy {
|
|
policy.Notes = CopyStringSlice(policy.Notes)
|
|
return policy
|
|
}
|
|
|
|
func CopyServerFileWorkspaceView(view ServerFileWorkspaceView) ServerFileWorkspaceView {
|
|
view.Directories = append([]PluginLogicalDirectory(nil), view.Directories...)
|
|
view.Files = append([]PluginLogicalFile(nil), view.Files...)
|
|
view.ConfigFields = append([]PluginConfigField(nil), view.ConfigFields...)
|
|
view.Transfer = CopyServerFileTransferPolicy(view.Transfer)
|
|
return view
|
|
}
|
|
|
|
func CopyServerFileEntry(entry ServerFileEntry) ServerFileEntry {
|
|
return entry
|
|
}
|
|
|
|
func CopyServerFileEntries(entries []ServerFileEntry) []ServerFileEntry {
|
|
if entries == nil {
|
|
return nil
|
|
}
|
|
out := make([]ServerFileEntry, len(entries))
|
|
copy(out, entries)
|
|
return out
|
|
}
|
|
|
|
func CopyServerFileListResult(result ServerFileListResult) ServerFileListResult {
|
|
result.Entries = CopyServerFileEntries(result.Entries)
|
|
result.Job = CopyJob(result.Job)
|
|
return result
|
|
}
|
|
|
|
func CopyServerFileUploadRequest(request ServerFileUploadRequest) ServerFileUploadRequest {
|
|
request.Payload = CopyBytes(request.Payload)
|
|
return request
|
|
}
|
|
|
|
func CopyServerFileUploadDispatch(dispatch ServerFileUploadDispatch) ServerFileUploadDispatch {
|
|
dispatch.Job = CopyJob(dispatch.Job)
|
|
return dispatch
|
|
}
|
|
|
|
func CopyServerFileDownloadResult(result ServerFileDownloadResult) ServerFileDownloadResult {
|
|
if result.Artifact != nil {
|
|
artifact := CopyArtifactDownloadReference(*result.Artifact)
|
|
result.Artifact = &artifact
|
|
}
|
|
result.Job = CopyJob(result.Job)
|
|
return result
|
|
}
|
|
|
|
func CopyRunFileInputChunkRequest(request RunFileInputChunkRequest) RunFileInputChunkRequest {
|
|
return request
|
|
}
|
|
|
|
func CopyRunFileInputChunk(chunk RunFileInputChunk) RunFileInputChunk {
|
|
chunk.Payload = CopyBytes(chunk.Payload)
|
|
return chunk
|
|
}
|
|
|
|
func CopyRunEndpoint(endpoint RunEndpoint) RunEndpoint {
|
|
endpoint.Capabilities = CopyStringSlice(endpoint.Capabilities)
|
|
endpoint.Capacity.PressureCodes = CopyStringSlice(endpoint.Capacity.PressureCodes)
|
|
return endpoint
|
|
}
|
|
|
|
func CopyJob(job Job) Job {
|
|
job.ExecutionInput.Inputs = CopyStringMap(job.ExecutionInput.Inputs)
|
|
job.ExecutionInput.LogSource = CopyRuntimeLogSourcePtr(job.ExecutionInput.LogSource)
|
|
job.ExecutionInput.LogSources = CopyRuntimeLogSources(job.ExecutionInput.LogSources)
|
|
job.ExecutionInput.DLLExtensions = append([]RuntimeDLLExtensionPlan(nil), job.ExecutionInput.DLLExtensions...)
|
|
job.ExecutionInput.SourceRCON = CopyRuntimeSourceRCONPlan(job.ExecutionInput.SourceRCON)
|
|
job.ExecutionInput.ServerDeploymentPlan = CopyServerDeploymentPlan(job.ExecutionInput.ServerDeploymentPlan)
|
|
job.ExecutionResult.ServerDeploymentEvidence = CopyServerDeploymentEvidence(job.ExecutionResult.ServerDeploymentEvidence)
|
|
job.ExecutionResult.DeploymentReceipt = CopyServerDeploymentExecutionReceipt(job.ExecutionResult.DeploymentReceipt)
|
|
if job.ExecutionInput.Deployment != nil {
|
|
copy := CopyServerDeploymentDefinition(*job.ExecutionInput.Deployment)
|
|
job.ExecutionInput.Deployment = ©
|
|
}
|
|
return job
|
|
}
|
|
|
|
func CopyRuntimeLogSourcePtr(source *RuntimeLogSource) *RuntimeLogSource {
|
|
if source == nil {
|
|
return nil
|
|
}
|
|
copy := *source
|
|
return ©
|
|
}
|
|
|
|
func CopyRuntimeLogSources(sources []RuntimeLogSource) []RuntimeLogSource {
|
|
if sources == nil {
|
|
return nil
|
|
}
|
|
return append([]RuntimeLogSource(nil), sources...)
|
|
}
|
|
|
|
func CopyRuntimeSourceRCONPlan(plan *RuntimeSourceRCONPlan) *RuntimeSourceRCONPlan {
|
|
if plan == nil {
|
|
return nil
|
|
}
|
|
copy := *plan
|
|
return ©
|
|
}
|
|
|
|
func CopyArtifact(artifact Artifact) Artifact {
|
|
return artifact
|
|
}
|
|
|
|
func CopyRuntimeBinding(binding RuntimeBinding) RuntimeBinding {
|
|
binding.Bindings = CopyStringMap(binding.Bindings)
|
|
binding.MissingKeys = CopyStringSlice(binding.MissingKeys)
|
|
return binding
|
|
}
|
|
|
|
func CopyRuntimeBindingUpdate(update RuntimeBindingUpdate) RuntimeBindingUpdate {
|
|
update.Bindings = CopyStringMap(update.Bindings)
|
|
return update
|
|
}
|
|
|
|
func CopyRuntimeBindingView(view RuntimeBindingView) RuntimeBindingView {
|
|
view.Keys = append([]RuntimeBindingKeyView(nil), view.Keys...)
|
|
view.MissingKeys = CopyStringSlice(view.MissingKeys)
|
|
return view
|
|
}
|
|
|
|
func CopyEncryptedComponentKey(key EncryptedComponentKey) EncryptedComponentKey {
|
|
return key
|
|
}
|
|
|
|
func CopyRunDistribution(distribution RunDistribution) RunDistribution {
|
|
return distribution
|
|
}
|
|
|
|
func CopyDependencyStatus(status DependencyStatus) DependencyStatus {
|
|
return status
|
|
}
|
|
|
|
func CopyDependencyCatalog(catalog DependencyCatalog) DependencyCatalog {
|
|
catalog.Probes = append([]DependencyProbeView(nil), catalog.Probes...)
|
|
catalog.Plans = append([]DependencyPlanView(nil), catalog.Plans...)
|
|
for i := range catalog.Plans {
|
|
catalog.Plans[i].Steps = append([]DependencyPlanStepView(nil), catalog.Plans[i].Steps...)
|
|
}
|
|
return catalog
|
|
}
|
|
|
|
func CopyRunUpdateJob(job RunUpdateJob) RunUpdateJob {
|
|
return job
|
|
}
|
|
|
|
func CopyRunDistributionGenerateRequest(request RunDistributionGenerateRequest) RunDistributionGenerateRequest {
|
|
return request
|
|
}
|
|
|
|
func CopyComponentKeyResetRequest(request ComponentKeyResetRequest) ComponentKeyResetRequest {
|
|
return request
|
|
}
|
|
|
|
func CopyComponentAuthenticationRequest(request ComponentAuthenticationRequest) ComponentAuthenticationRequest {
|
|
return request
|
|
}
|
|
|
|
func CopyComponentAuthenticationResult(result ComponentAuthenticationResult) ComponentAuthenticationResult {
|
|
return result
|
|
}
|
|
|
|
func CopyServerRuntimeAction(action ServerRuntimeAction) ServerRuntimeAction {
|
|
return action
|
|
}
|
|
|
|
func CopyServerRuntimeActions(actions ServerRuntimeActions) ServerRuntimeActions {
|
|
actions.Actions = CopyServerRuntimeActionSlice(actions.Actions)
|
|
return actions
|
|
}
|
|
|
|
func CopyServerRuntimeActionSlice(actions []ServerRuntimeAction) []ServerRuntimeAction {
|
|
if actions == nil {
|
|
return nil
|
|
}
|
|
out := make([]ServerRuntimeAction, len(actions))
|
|
copy(out, actions)
|
|
return out
|
|
}
|
|
|
|
func CopyRunUpdateRequest(request RunUpdateRequest) RunUpdateRequest {
|
|
return request
|
|
}
|
|
|
|
func CopyDependencyJobRequest(request DependencyJobRequest) DependencyJobRequest {
|
|
return request
|
|
}
|
|
|
|
func CopyLogBackfillRequest(request LogBackfillRequest) LogBackfillRequest {
|
|
return request
|
|
}
|
|
|
|
func CopyLogStream(stream LogStream) LogStream {
|
|
return stream
|
|
}
|