mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-09-07 00:55:55 +00:00
MarshalLogMessage serializes the log message and prepends additional encoding information to each message. Currently, we prepend three bytes to each log message: byte[0]: encodeVersion - this is currently a constant within the code. If we modify structs such that they encode differently, we'll have to change the constant and keep previous versions of structs for deserialization. byte[1]: encodeType (e.g. "json", etc.) byte[2]: logMessageType If we get into a situation where we want more flexibility in these message header bytes—for example, if we want to use more than three bytes—we could do something with the first bit of the encodeVersion: if it's 1, that could indicate that there are additional header bytes, and the following seven bits could indicate how many. |
||
|---|---|---|
| .. | ||
| alpha | ||
| api | ||
| computer.go | ||
| snapshot.go | ||
| writelog.go | ||
| writelog_test.go | ||