Implement platform management features

This commit is contained in:
npc0-hue
2026-08-17 08:48:45 +08:00
parent 65353cf269
commit 302f1f64b7
38 changed files with 2185 additions and 110 deletions
+8
View File
@@ -1667,6 +1667,14 @@ func ValidateLogStream(stream domain.LogStream) error {
if !validLogStorageBackend(stream.StorageBackend) {
violations = append(violations, "storageBackend is invalid")
}
hasSessionID := strings.TrimSpace(stream.LogSessionID) != ""
hasSessionStart := !stream.SessionStartedAt.IsZero()
if hasSessionID != hasSessionStart {
violations = append(violations, "logSessionId and sessionStartedAt must be provided together")
}
if (hasSessionID || hasSessionStart) && stream.Source != domain.LogStreamSourceProcess {
violations = append(violations, "log session metadata is only valid for process streams")
}
return finish(violations)
}