Stream live server logs over SSE

This commit is contained in:
npc0-hue
2026-08-03 22:28:54 +08:00
parent 5d4fca14f9
commit 7eac1926dd
48 changed files with 1526 additions and 263 deletions
+13
View File
@@ -48,6 +48,13 @@ type LogStreamCursorResult struct {
LatestSeq uint64
}
type LogStreamEvent struct {
ServerInstanceID string
Stream LogStream
Entry LogEntry
LatestSeq uint64
}
type LogBatchRecord struct {
Checksum string
FirstSeq uint64
@@ -87,6 +94,12 @@ func CopyLogStreamCursorResult(result LogStreamCursorResult) LogStreamCursorResu
return result
}
func CopyLogStreamEvent(event LogStreamEvent) LogStreamEvent {
event.Stream = CopyLogStream(event.Stream)
event.Entry = CopyLogEntry(event.Entry)
return event
}
func CopyLogBatchRecord(record LogBatchRecord) LogBatchRecord {
record.Entries = CopyLogEntries(record.Entries)
return record