-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodel.go
More file actions
27 lines (23 loc) · 889 Bytes
/
model.go
File metadata and controls
27 lines (23 loc) · 889 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package stepmark
import "time"
// Event is a single recorded step in a trace.
type Event struct {
Stage string `json:"stage"`
Action string `json:"action"`
Timestamp time.Time `json:"timestamp"`
Meta map[string]any `json:"meta,omitempty"`
}
// EntityTrace holds the ordered events for a single tracked entity.
type EntityTrace struct {
EntityID string `json:"entity_id"`
Kind string `json:"kind,omitempty"`
Meta map[string]any `json:"meta,omitempty"`
Events []Event `json:"events"`
}
// Trace is the complete collected output, containing per-entity
// traces, unscoped events, and optional trace-level metadata.
type Trace struct {
Meta map[string]any `json:"meta,omitempty"`
Entities map[string]EntityTrace `json:"entities,omitempty"`
Events []Event `json:"events,omitempty"`
}