diff options
| author | Paul Buetow <paul@buetow.org> | 2026-05-13 14:28:43 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-05-13 14:28:43 +0300 |
| commit | a73b7973531f2b8632269a8c8359acf69ee61f45 (patch) | |
| tree | 5f9e96b893fcf1a2ca774c76276a07ecfa565711 /internal/streamrow | |
| parent | 27b94f917064948fa33141309a3f08deb40ffde2 (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/streamrow')
| -rw-r--r-- | internal/streamrow/row.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/internal/streamrow/row.go b/internal/streamrow/row.go index 457fcc0..026aa93 100644 --- a/internal/streamrow/row.go +++ b/internal/streamrow/row.go @@ -5,6 +5,7 @@ import ( "time" "ior/internal/event" + "ior/internal/globalfilter" "ior/internal/types" ) @@ -121,6 +122,15 @@ func New(seq uint64, pair *event.Pair) Row { return row } +// --- compile-time interface satisfaction assertion --- +// +// Row must satisfy globalfilter.Candidate so the TUI eventstream model can +// pass stream rows directly into Filter.Matches for live filtering. All +// Candidate methods are defined on the value receiver so both Row and *Row +// satisfy the interface; we assert the value form as it is the common usage. + +var _ globalfilter.Candidate = Row{} + // NewWarning creates a synthetic row for non-fatal runtime warnings. func NewWarning(seq uint64, message string) Row { now := uint64(time.Now().UnixNano()) |
