qri-io / qri

you're invited to a data party!
https://qri.io
GNU General Public License v3.0
1.11k stars 66 forks source link

feat(logbook): add `logPutter` interface for transactional saves #1886

Closed b5 closed 3 years ago

b5 commented 3 years ago

this is an incomplete interface, but gets us a short-term solution for opstores that need an interface for transactional logbook updates. To make use of this an posture implementation should add a new method, where the implementation should be consistent with MergeLog semantics. The following should work:

func (s *Opstore) PutLog(ctx context.Context, l *oplog.Log) error {
  return  s.MergeLog(l)
}

This interface is not implemented for all write operations yet, but provides a mechanism to do so in follow up changes