1
0
Fork 0
mirror of https://github.com/anyproto/any-sync.git synced 2025-06-09 09:35:03 +09:00
any-sync/consensus/consensus.go
2022-09-30 19:16:44 +03:00

22 lines
413 B
Go

package consensus
import "time"
type Log struct {
Id []byte `bson:"_id"`
Records []Record `bson:"records"`
}
type Record struct {
Id []byte `bson:"id"`
PrevId []byte `bson:"prevId"`
Payload []byte `bson:"payload"`
Created time.Time `bson:"created"'`
}
func (l Log) CopyRecords() Log {
l2 := l
l2.Records = make([]Record, len(l.Records))
copy(l2.Records, l.Records)
return l2
}