1232 lines
31 KiB
Go
1232 lines
31 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"
|
|
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 LogStreamSource string
|
|
|
|
const (
|
|
LogStreamSourceProcess LogStreamSource = "process"
|
|
LogStreamSourceFile LogStreamSource = "file"
|
|
LogStreamSourcePlugin LogStreamSource = "plugin"
|
|
)
|
|
|
|
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
|
|
}
|
|
|
|
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
|
|
Permissions []string
|
|
BridgeActions []string
|
|
}
|
|
|
|
type GamePluginBridge struct {
|
|
Actions []string
|
|
}
|
|
|
|
type GamePluginManifestServer struct {
|
|
Type string
|
|
DisplayName string
|
|
SupportedOS []string
|
|
CreateFormSchema string
|
|
}
|
|
|
|
type GamePluginManifestAI struct {
|
|
Purposes []string
|
|
}
|
|
|
|
type GamePluginRemoteAccess struct {
|
|
Methods []string
|
|
RunCapabilities []string
|
|
DatabaseEngines []string
|
|
RCON bool
|
|
LogTransfer bool
|
|
}
|
|
|
|
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
|
|
Pages []GamePluginPage
|
|
AI GamePluginManifestAI
|
|
RemoteAccess GamePluginRemoteAccess
|
|
}
|
|
|
|
type GamePluginManifestRegistration struct {
|
|
ManifestRef string
|
|
Manifest GamePluginManifest
|
|
}
|
|
|
|
type GamePlugin struct {
|
|
ID string
|
|
Name string
|
|
Description string
|
|
Version string
|
|
ServerType string
|
|
ServerDisplayName string
|
|
SupportedOS []string
|
|
ManifestRef string
|
|
CreateFormSchemaRef string
|
|
RequiredRunCapabilities []string
|
|
DeclaredPermissions []string
|
|
Permissions PluginPermissions
|
|
LifecycleActions PluginLifecycleActions
|
|
BridgeActions []string
|
|
Pages []GamePluginPage
|
|
Tags []string
|
|
AIPurposes []string
|
|
RemoteAccess GamePluginRemoteAccess
|
|
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
|
|
Capabilities []string
|
|
DeclaredPermissions []string
|
|
Permissions PluginPermissions
|
|
LifecycleActions PluginLifecycleActions
|
|
BridgeActions []string
|
|
Pages []GamePluginPage
|
|
Tags []string
|
|
AIPurposes []string
|
|
RemoteAccess GamePluginRemoteAccess
|
|
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"
|
|
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
|
|
RunEndpointID string
|
|
Name string
|
|
OwnerUserID string
|
|
AdminUserIDs []string
|
|
State ServerInstanceState
|
|
ConfigVersion int
|
|
CreatedAt time.Time
|
|
UpdatedAt time.Time
|
|
}
|
|
|
|
type ServerInstanceUpdate struct {
|
|
Name *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
|
|
Source string
|
|
UpdatedAt time.Time
|
|
}
|
|
|
|
type ConfigDiffLine struct {
|
|
Kind string
|
|
OldNumber int
|
|
NewNumber int
|
|
Content string
|
|
}
|
|
|
|
type ServerConfigDiffRequest struct {
|
|
ServerInstanceID string
|
|
ExpectedConfigVersion int
|
|
Key string
|
|
ProposedContent string
|
|
ProposedContentInputRef string
|
|
}
|
|
|
|
type ServerConfigDiffPreview struct {
|
|
ServerInstanceID string
|
|
ConfigVersion int
|
|
Key string
|
|
CurrentContent string
|
|
ProposedContent string
|
|
ProposedContentInputRef string
|
|
Diff []ConfigDiffLine
|
|
HasChanges bool
|
|
Source string
|
|
ReviewedAt time.Time
|
|
}
|
|
|
|
type ServerConfigWriteApproval struct {
|
|
ServerInstanceID string
|
|
ExpectedConfigVersion int
|
|
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
|
|
ExpectedConfigVersion int
|
|
IdempotencyKey string
|
|
}
|
|
|
|
type FileOperationDispatchResult struct {
|
|
ServerInstanceID string
|
|
PluginID string
|
|
Operation FileOperationKind
|
|
Key string
|
|
InputRef string
|
|
Job Job
|
|
Status string
|
|
}
|
|
|
|
type RunCapacity struct {
|
|
MaxJobs int
|
|
RunningJobs int
|
|
QueuedJobs int
|
|
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"
|
|
JobCapabilityRemoteRunDBSQLiteQuery = "remote.run.db.sqlite.query"
|
|
JobCapabilityRemoteRunLogsTransfer = "remote.run.logs.transfer"
|
|
JobCapabilityRemoteRunRCONCommand = "remote.run.rcon.command"
|
|
JobCapabilityRunSelfUpdate = "run.self-update"
|
|
JobCapabilityDistributionBuild = "distribution.build"
|
|
JobCapabilityDependenciesCheck = "dependencies.check"
|
|
JobCapabilityDependenciesInstall = "dependencies.install"
|
|
JobCapabilityLogsBackfill = "logs.backfill"
|
|
)
|
|
|
|
type RunEndpoint struct {
|
|
ID string
|
|
DisplayName string
|
|
Version string
|
|
Status RunEndpointStatus
|
|
Capabilities []string
|
|
Capacity RunCapacity
|
|
LastHeartbeatAt time.Time
|
|
}
|
|
|
|
type JobProgress struct {
|
|
Percent int
|
|
Message string
|
|
}
|
|
|
|
type Job struct {
|
|
ID string
|
|
ServerInstanceID string
|
|
RunEndpointID string
|
|
Capability string
|
|
TargetKey string
|
|
InputRef string
|
|
IdempotencyKey string
|
|
State JobState
|
|
Progress JobProgress
|
|
ResultRef 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
|
|
ProfileKey string
|
|
Mode string
|
|
Bindings map[string]string
|
|
MissingKeys []string
|
|
Status RuntimeBindingStatus
|
|
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
|
|
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
|
|
Message string
|
|
CheckedAt time.Time
|
|
UpdatedAt time.Time
|
|
}
|
|
|
|
type ClientManagerBuildJob struct {
|
|
ID string
|
|
ServerInstanceID string
|
|
PluginID string
|
|
ProfileKey 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
|
|
JobID string
|
|
IdempotencyKey string
|
|
Status DistributionJobStatus
|
|
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
|
|
TargetOS string
|
|
TargetArch string
|
|
IdempotencyKey string
|
|
Install bool
|
|
}
|
|
|
|
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 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 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.BridgeActions = CopyStringSlice(plugin.BridgeActions)
|
|
plugin.Pages = CopyGamePluginPageSlice(plugin.Pages)
|
|
plugin.Tags = CopyStringSlice(plugin.Tags)
|
|
plugin.AIPurposes = CopyStringSlice(plugin.AIPurposes)
|
|
plugin.RemoteAccess = CopyGamePluginRemoteAccess(plugin.RemoteAccess)
|
|
plugin.ValidationViolations = CopyStringSlice(plugin.ValidationViolations)
|
|
return plugin
|
|
}
|
|
|
|
func CopyPluginMarketplacePlugin(plugin PluginMarketplacePlugin) PluginMarketplacePlugin {
|
|
plugin.SupportedOS = CopyStringSlice(plugin.SupportedOS)
|
|
plugin.Capabilities = CopyStringSlice(plugin.Capabilities)
|
|
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.RemoteAccess = CopyGamePluginRemoteAccess(plugin.RemoteAccess)
|
|
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)
|
|
return registration
|
|
}
|
|
|
|
func CopyGamePluginManifest(manifest GamePluginManifest) GamePluginManifest {
|
|
manifest.Tags = CopyStringSlice(manifest.Tags)
|
|
manifest.Server.SupportedOS = CopyStringSlice(manifest.Server.SupportedOS)
|
|
manifest.Bridge.Actions = CopyStringSlice(manifest.Bridge.Actions)
|
|
manifest.Capabilities = CopyStringSlice(manifest.Capabilities)
|
|
manifest.Permissions = CopyStringSlice(manifest.Permissions)
|
|
manifest.Pages = CopyGamePluginPageSlice(manifest.Pages)
|
|
manifest.AI.Purposes = CopyStringSlice(manifest.AI.Purposes)
|
|
manifest.RemoteAccess = CopyGamePluginRemoteAccess(manifest.RemoteAccess)
|
|
return manifest
|
|
}
|
|
|
|
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)
|
|
}
|
|
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)
|
|
return instance
|
|
}
|
|
|
|
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)
|
|
return endpoint
|
|
}
|
|
|
|
func CopyJob(job Job) Job {
|
|
return job
|
|
}
|
|
|
|
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 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 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
|
|
}
|