| 1 | package eventwire |
| 2 | |
| 3 | import "reasonix/internal/event" |
| 4 | |
| 5 | // ReadStatus is the JSON form of event.ReadStatusPayload. |
| 6 | type ReadStatus struct { |
| 7 | Verdict string `json:"verdict,omitempty"` |
| 8 | ReadID string `json:"readId"` |
| 9 | Generation uint64 `json:"generation,omitempty"` |
| 10 | Sequence uint64 `json:"seq,omitempty"` |
| 11 | Path string `json:"path"` |
| 12 | Intent string `json:"intent,omitempty"` |
| 13 | State string `json:"state"` |
| 14 | Covered [][2]int `json:"covered,omitempty"` |
| 15 | Missing [][2]int `json:"missing,omitempty"` |
| 16 | SourceEnd *int `json:"sourceEnd,omitempty"` |
| 17 | HasMore bool `json:"hasMore,omitempty"` |
| 18 | Reason string `json:"reason,omitempty"` |
| 19 | Recovery string `json:"recovery,omitempty"` |
| 20 | Active bool `json:"active,omitempty"` |
| 21 | } |
| 22 | |
| 23 | func toWireReadStatus(in *event.ReadStatusPayload) *ReadStatus { |
| 24 | if in == nil { |
| 25 | return nil |
| 26 | } |
| 27 | return &ReadStatus{ |
| 28 | Verdict: in.Verdict, |
| 29 | ReadID: in.ReadID, Generation: in.Generation, Sequence: in.Sequence, |
| 30 | Path: in.Path, Intent: in.Intent, State: in.State, |
| 31 | Covered: in.Covered, Missing: in.Missing, SourceEnd: in.SourceEnd, |
| 32 | HasMore: in.HasMore, Reason: in.Reason, Recovery: in.Recovery, Active: in.Active, |
| 33 | } |
| 34 | } |
| 35 |