Add run lifecycle report projection

This commit is contained in:
npc0-hue
2026-08-06 20:35:13 +08:00
parent 4e78957a60
commit 68921b3f68
13 changed files with 270 additions and 8 deletions
+30
View File
@@ -53,6 +53,26 @@ type RunControlHeartbeatResult struct {
ServerTime time.Time
}
type RunLifecycleReport struct {
RunEndpointID string
SessionToken string
ServerInstanceID string
Capability string
State JobState
Progress RunJobProgressReport
Message string
ErrorCode string
ExecutionResult JobExecutionResult
}
type RunLifecycleReportResult struct {
Accepted bool
RunEndpointID string
ServerInstanceID string
ProjectedState ServerInstanceState
ServerTime time.Time
}
type RunControlSession struct {
RunEndpointID string
SessionToken string `json:"-"`
@@ -103,6 +123,16 @@ func CopyRunControlHeartbeatResult(result RunControlHeartbeatResult) RunControlH
return result
}
func CopyRunLifecycleReport(report RunLifecycleReport) RunLifecycleReport {
report.ExecutionResult.ServerDeploymentEvidence = CopyServerDeploymentEvidence(report.ExecutionResult.ServerDeploymentEvidence)
report.ExecutionResult.DeploymentReceipt = CopyServerDeploymentExecutionReceipt(report.ExecutionResult.DeploymentReceipt)
return report
}
func CopyRunLifecycleReportResult(result RunLifecycleReportResult) RunLifecycleReportResult {
return result
}
func CopyRunControlSession(session RunControlSession) RunControlSession {
session.UsedNonces = CopyStringSlice(session.UsedNonces)
return session