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" DistributionComponentClientManager DistributionComponentKind = "client-manager" ) 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 AuditResult string const ( AuditResultSuccess AuditResult = "success" AuditResultDenied AuditResult = "denied" AuditResultFailed AuditResult = "failed" AuditResultQueued AuditResult = "queued" ) 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 ApprovalRequired []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 ClientManagerRef string DLLExtensionRefs []string Platforms []string } type RuntimeDependencyProbe struct { Key string Kind string TargetKey string Required bool MinimumVersion 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 RuntimeLogEventSeverity string const ( RuntimeLogEventSeverityInfo RuntimeLogEventSeverity = "info" RuntimeLogEventSeverityNotice RuntimeLogEventSeverity = "notice" RuntimeLogEventSeverityWarning RuntimeLogEventSeverity = "warning" RuntimeLogEventSeverityCritical RuntimeLogEventSeverity = "critical" ) type RuntimeLogEvent struct { Key string Title string SourceKey string EventType string Permission string SchemaRef string RetentionDays int Severity RuntimeLogEventSeverity } type RuntimeTransportProfile struct { Key string Kind string TargetKey string Capabilities []string } type RuntimeDataTarget struct { Key string Kind string TransportKey string SourceRootKey string SourcePath string WorkspaceKey string RefreshPolicy string MaxBytes int64 Platforms []string } type RuntimeClientManagerProfile struct { Key string DisplayName string Version string RepositoryURL string RevisionPolicy string Branch string Tag string Revision string SupportedTargets []RuntimeTarget BuildSystem string WorkspaceRef string EntryRef string ConfigTemplates []RuntimeConfigTemplate OutputArtifacts []string Deployment RuntimeClientManagerDeployment Lifecycle RuntimeClientManagerLifecycle Health RuntimeClientManagerHealth Compatibility RuntimeClientManagerCompatibility UpdatePolicy RuntimeClientManagerUpdatePolicy } 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 SCUMExecutableChecksum 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 SCUMExecutableChecksum string UE4SSABI string RCONPort int } // RuntimeSourceRCONPlan is a frozen, secret-free loopback connection plan for // a ready SCUM 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 } // RuntimeServerDeploymentProfile is a legacy game-specific deployment template // declaration kept for backward-compatible manifest decoding. type RuntimeServerDeploymentProfile struct { Key string Version string SupportedTargets []RuntimeTarget SteamAppID string ExecutableKey string InstallRootKey string ConfigKey string ConfigFormat string Prerequisites []RuntimeServerPrerequisite ConfigMappings []RuntimeServerConfigMapping DiscoveryMarkers []RuntimeServerDiscoveryMarker VerificationChecks []RuntimeServerVerificationCheck } type GamePluginRuntimeProfiles struct { Discovery []RuntimeDiscoveryProbe LifecycleProfiles []RuntimeLifecycleProfile DependencyProbes []RuntimeDependencyProbe InstallPlans []RuntimeInstallPlan ServerDeployments []RuntimeServerDeploymentProfile LogSources []RuntimeLogSource LogEvents []RuntimeLogEvent TransportProfiles []RuntimeTransportProfile DataTargets []RuntimeDataTarget ClientManagers []RuntimeClientManagerProfile 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 SCUMLiveData SCUMLiveDataManifest MapTrajectories *GameMapTrajectoryDeclaration } type GamePluginManifestRegistration struct { ManifestRef string Manifest GamePluginManifest AssetFiles []PluginAssetFile } type PluginAssetFile struct { Path string Content 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 SCUMLiveData SCUMLiveDataManifest MapTrajectories *GameMapTrajectoryDeclaration 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 MapTrajectories *GameMapTrajectoryDeclaration 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" PluginBridgeActionClientManager PluginBridgeAction = "client-manager.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 identifies an optional operator-selected deployment // target for post-creation deployment operations. It never selects a // distribution builder or replaces the server's generated Run endpoint. 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 ( 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 RunCapacity struct { MaxJobs int RunningJobs int QueuedJobs int LogBacklogBatches int ArtifactBacklogChunks int PressureCodes []string Summary string } const ( JobCapabilityConfigWrite = "config.write" 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" JobCapabilityRemoteRunDBSQLiteProbe = "remote.run.db.sqlite.probe" JobCapabilityRemoteRunDBSQLiteQuery = "remote.run.db.sqlite.query" JobCapabilityRemoteRunLogsTransfer = "remote.run.logs.transfer" JobCapabilityRemoteRunRCONCommand = "remote.run.rcon.command" JobCapabilityRemoteRunProtectedSQL = "remote.run.protected.sql" JobCapabilityRemoteRunProtectedRCON = "remote.run.protected.rcon" 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 SQLiteSchemaProbe *SCUMSchemaProbeRequest SQLiteTemplate *SCUMSQLiteTemplateRequest RCONTemplate *SCUMTypedRCONTemplateRequest } 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 AuditSummary string Content string SQLiteSchemaProbe *SCUMSchemaProbeResult SQLiteTemplate *SCUMSQLiteTemplateResult RCONTemplate *SCUMTypedRCONTemplateResult 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 ClientManagerDistribution struct { ID string ServerInstanceID string PluginID string ProfileKey string Version string TargetOS string TargetArch string RepositoryURL string SourceRevision 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 ClientManagerBuildJob struct { ID string ServerInstanceID string PluginID string ProfileKey string Version string TargetOS string TargetArch string RepositoryURL string SourceRevision string ArtifactID string Checksum string KeyGeneration int LogsRef string Status DistributionJobStatus CreatedAt 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 ClientManagerBuildRequest struct { ServerInstanceID string ProfileKey string TargetOS string TargetArch string RepositoryURL string SourceRevision 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 LatestSeq uint64 StorageBackend LogStorageBackend RetentionPolicy string CreatedAt time.Time UpdatedAt time.Time } type AuditEvent struct { ID string ActorID string Action string ResourceKind string ResourceID string Result AuditResult Summary string CreatedAt 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 } 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 ClientManagerDistributionFilter struct { ServerInstanceID string ProfileKey string TargetOS string TargetArch string Status DistributionStatus } type DependencyStatusFilter struct { ServerInstanceID string ProbeKey string State DependencyState } type ClientManagerBuildJobFilter struct { ServerInstanceID string ProfileKey string Status DistributionJobStatus } type RunUpdateJobFilter struct { ServerInstanceID string Status DistributionJobStatus } type LogStreamFilter struct { ServerInstanceID string StreamKey string } type AuditEventFilter struct { ActorID string ResourceKind string ResourceID string Result AuditResult } 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.SCUMLiveData = CopySCUMLiveDataManifest(plugin.SCUMLiveData) if plugin.MapTrajectories != nil { value := CopyGameMapTrajectoryDeclaration(*plugin.MapTrajectories) plugin.MapTrajectories = &value } 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) if plugin.MapTrajectories != nil { value := CopyGameMapTrajectoryDeclaration(*plugin.MapTrajectories) plugin.MapTrajectories = &value } 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) manifest.SCUMLiveData = CopySCUMLiveDataManifest(manifest.SCUMLiveData) if manifest.MapTrajectories != nil { value := CopyGameMapTrajectoryDeclaration(*manifest.MapTrajectories) manifest.MapTrajectories = &value } 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) lifecycle.ApprovalRequired = CopyStringSlice(lifecycle.ApprovalRequired) 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.ServerDeployments = append([]RuntimeServerDeploymentProfile(nil), profiles.ServerDeployments...) for i := range profiles.ServerDeployments { profiles.ServerDeployments[i] = CopyRuntimeServerDeploymentProfile(profiles.ServerDeployments[i]) } profiles.LogSources = append([]RuntimeLogSource(nil), profiles.LogSources...) profiles.LogEvents = append([]RuntimeLogEvent(nil), profiles.LogEvents...) 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.ClientManagers = append([]RuntimeClientManagerProfile(nil), profiles.ClientManagers...) for i := range profiles.ClientManagers { profiles.ClientManagers[i].SupportedTargets = append([]RuntimeTarget(nil), profiles.ClientManagers[i].SupportedTargets...) profiles.ClientManagers[i].ConfigTemplates = append([]RuntimeConfigTemplate(nil), profiles.ClientManagers[i].ConfigTemplates...) profiles.ClientManagers[i].OutputArtifacts = CopyStringSlice(profiles.ClientManagers[i].OutputArtifacts) profiles.ClientManagers[i].Deployment.Arguments = CopyStringSlice(profiles.ClientManagers[i].Deployment.Arguments) profiles.ClientManagers[i].Deployment.RequiredRunCapabilities = CopyStringSlice(profiles.ClientManagers[i].Deployment.RequiredRunCapabilities) profiles.ClientManagers[i].Lifecycle.Actions = CopyStringSlice(profiles.ClientManagers[i].Lifecycle.Actions) profiles.ClientManagers[i].Health.RequiredCapabilities = CopyStringSlice(profiles.ClientManagers[i].Health.RequiredCapabilities) } 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 CopyRuntimeServerDeploymentProfile(profile RuntimeServerDeploymentProfile) RuntimeServerDeploymentProfile { profile.Prerequisites = append([]RuntimeServerPrerequisite(nil), profile.Prerequisites...) profile.SupportedTargets = append([]RuntimeTarget(nil), profile.SupportedTargets...) profile.ConfigMappings = append([]RuntimeServerConfigMapping(nil), profile.ConfigMappings...) profile.DiscoveryMarkers = append([]RuntimeServerDiscoveryMarker(nil), profile.DiscoveryMarkers...) profile.VerificationChecks = append([]RuntimeServerVerificationCheck(nil), profile.VerificationChecks...) return profile } 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 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.ExecutionInput.SQLiteSchemaProbe = CopySCUMSchemaProbeRequestPtr(job.ExecutionInput.SQLiteSchemaProbe) job.ExecutionInput.SQLiteTemplate = CopySCUMSQLiteTemplateRequestPtr(job.ExecutionInput.SQLiteTemplate) job.ExecutionInput.RCONTemplate = CopySCUMTypedRCONTemplateRequestPtr(job.ExecutionInput.RCONTemplate) job.ExecutionResult.SQLiteSchemaProbe = CopySCUMSchemaProbeResultPtr(job.ExecutionResult.SQLiteSchemaProbe) job.ExecutionResult.SQLiteTemplate = CopySCUMSQLiteTemplateResultPtr(job.ExecutionResult.SQLiteTemplate) job.ExecutionResult.RCONTemplate = CopySCUMTypedRCONTemplateResultPtr(job.ExecutionResult.RCONTemplate) 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 CopyClientManagerDistribution(distribution ClientManagerDistribution) ClientManagerDistribution { 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 CopyClientManagerBuildJob(job ClientManagerBuildJob) ClientManagerBuildJob { return job } func CopyRunUpdateJob(job RunUpdateJob) RunUpdateJob { return job } func CopyRunDistributionGenerateRequest(request RunDistributionGenerateRequest) RunDistributionGenerateRequest { return request } func CopyClientManagerBuildRequest(request ClientManagerBuildRequest) ClientManagerBuildRequest { 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 } func CopyAuditEvent(event AuditEvent) AuditEvent { return event }