EncodeLogRecordPst encodes the position information of a log record.
(pst *LogRecordPst)
| 80 | |
| 81 | // EncodeLogRecordPst encodes the position information of a log record. |
| 82 | func EncodeLogRecordPst(pst *LogRecordPst) []byte { |
| 83 | buf := make([]byte, binary.MaxVarintLen16+binary.MaxVarintLen64) |
| 84 | var index = 0 |
| 85 | index += binary.PutVarint(buf[index:], int64(pst.Fid)) // Encode file ID |
| 86 | index += binary.PutVarint(buf[index:], pst.Offset) // Encode offset |
| 87 | return buf[:index] |
| 88 | } |
| 89 | |
| 90 | // DecodeLogRecordPst decodes the position information from a byte buffer. |
| 91 | func DecodeLogRecordPst(buf []byte) *LogRecordPst { |
no outgoing calls
no test coverage detected