You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* feat: refactor Signal and Event to CloudEvent types with own identity
Refactor Signal and Event structs to use CloudEvent wrappers, add
pack/unpack for wire transport, and fix code quality issues including
typos, dead code, missing struct tags, inconsistent error handling,
and potential panics.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Fixing lint
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
The `vss.Event` struct represents vehicle events (harsh braking, collisions, etc.) and **directly corresponds to the database schema**:
464
+
The `vss.Event` type is a CloudEvent type alias (`type Event = cloudevent.CloudEvent[EventData]`) representing vehicle events (harsh braking, collisions, etc.) and **directly corresponds to the database schema**:
465
465
466
466
```go
467
-
type Event struct {
468
-
Subject string // Vehicle/entity DID
469
-
Source string // Integration source
470
-
Producer string // Device DID
471
-
CloudEventID string // CloudEvent identifier
472
-
Name string // Event name (e.g., "behavior.harshBraking")
473
-
Timestamp time.Time // When the event occurred
474
-
DurationNs uint64 // Event duration in nanoseconds
475
-
Metadata string // JSON metadata
476
-
Tags []string // Event tags
467
+
// EventData holds the domain-specific payload for an event.
468
+
type EventData struct {
469
+
Name string // Event name (e.g., "behavior.harshBraking")
470
+
Timestamp time.Time // When the event occurred
471
+
DurationNs uint64 // Event duration in nanoseconds
472
+
Metadata string // JSON metadata
477
473
}
474
+
475
+
// Event is a CloudEvent with EventData as the payload.
0 commit comments