Package reclog contains readers and writers for a record wrapper format used by maintner.
AppendRecordToFile opens the named filename for append (creating it if necessary) and adds the provided data record to the end. The caller is responsible for file locking.
ForeachFileRecord calls fn for each record in the named file. Calls to fn are made serially. If fn returns an error, iteration ends and that error is returned.
ForeachRecord calls fn for each record in r. Calls to fn are made serially. If fn returns an error, iteration ends and that error is returned. The startOffset is where in the file r represents. It should be 0 if reading from the beginning of a file.
WriteRecord writes the record data to w, formatting the record wrapper with the given offset off. It is the caller's responsibility to pass the correct offset. Exactly one Write call will be made to w.
RecordCallback is the callback signature accepted by ForeachFileRecord and ForeachRecord, which read the mutation log format used by DiskMutationLogger.
Offset is the offset in the logical of physical file. hdr and bytes are only valid until the function returns and must not be retained.
hdr is the record header, in the form "REC@c765c9a+1d3=" (REC@ <hex offset> + <hex len(rec)> + '=').
rec is the proto3 binary marshalled representation of *maintpb.Mutation.
If the callback returns an error, iteration stops.