]> git.giacomolli.uk - onehouse/blob - driver/result_record.go
Queue device commands and replay first results
[onehouse] / driver / result_record.go
1 package driver
2
3 import "onehouse/protocol"
4
5 // ResultRecord holds the first result and its stable replay metadata. Pass both
6 // fields unchanged to Publisher.Result. Lookup and Remember return independent
7 // timestamp pointers, so callers cannot change the ledger.
8 type ResultRecord struct {
9 Metadata protocol.Metadata
10 Payload protocol.ResultPayload
11 }
12
13 func (r ResultRecord) clone() ResultRecord {
14 if r.Metadata.SentAt != nil {
15 timestamp := *r.Metadata.SentAt
16 r.Metadata.SentAt = &timestamp
17 }
18
19 return r
20 }