summaryrefslogtreecommitdiff
path: root/internal/tui
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-05-13 14:28:43 +0300
committerPaul Buetow <paul@buetow.org>2026-05-13 14:28:43 +0300
commita73b7973531f2b8632269a8c8359acf69ee61f45 (patch)
tree5f9e96b893fcf1a2ca774c76276a07ecfa565711 /internal/tui
parent27b94f917064948fa33141309a3f08deb40ffde2 (diff)
add compile-time interface assertions for public types (task c4)
Extend the var _ Interface = (*Concrete)(nil) coverage started in j3 to cover the remaining public types not yet guarded: - *file.FdFile → file.File (file/file.go) - streamrow.Row → globalfilter.Candidate (streamrow/row.go; adds globalfilter import — no cycle since globalfilter does not import streamrow) - *streamrow.RingBuffer → eventstream.Source (tui/eventstream/ringbuffer.go; already a type alias for streamrow.RingBuffer) - *probemanager.Manager → tui/probes.Manager (tui/probes/model.go) - All 9 generated *types.*Event types → event.Event in the new file internal/event/interface_assertions.go (non-generated, lives in the event package which already imports types, so no new import cycle) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'internal/tui')
-rw-r--r--internal/tui/eventstream/ringbuffer.go8
-rw-r--r--internal/tui/probes/model.go8
2 files changed, 16 insertions, 0 deletions
diff --git a/internal/tui/eventstream/ringbuffer.go b/internal/tui/eventstream/ringbuffer.go
index 8644b42..8879114 100644
--- a/internal/tui/eventstream/ringbuffer.go
+++ b/internal/tui/eventstream/ringbuffer.go
@@ -15,3 +15,11 @@ const ringBufferCapacity = streamrow.RingBufferCapacity
func NewRingBuffer() *RingBuffer {
return streamrow.NewRingBuffer()
}
+
+// --- compile-time interface satisfaction assertion ---
+//
+// *RingBuffer (= *streamrow.RingBuffer) must satisfy the Source contract so
+// the TUI dashboard and stream views can receive live events without importing
+// the lower-level streamrow package directly.
+
+var _ Source = (*RingBuffer)(nil)
diff --git a/internal/tui/probes/model.go b/internal/tui/probes/model.go
index baf22e8..b7e694f 100644
--- a/internal/tui/probes/model.go
+++ b/internal/tui/probes/model.go
@@ -346,3 +346,11 @@ func truncateText(s string, limit int) string {
}
return string(runes[:limit-3]) + "..."
}
+
+// --- compile-time interface satisfaction assertion ---
+//
+// *probemanager.Manager must satisfy the Manager interface defined in this
+// package. The tui/probes package already imports probemanager, so this
+// assertion adds no new dependency.
+
+var _ Manager = (*probemanager.Manager)(nil)