setEntryHeaderBuf sets the entry header buff.
(buf []byte)
| 87 | |
| 88 | // setEntryHeaderBuf sets the entry header buff. |
| 89 | func (e *Entry) setEntryHeaderBuf(buf []byte) int { |
| 90 | index := 4 |
| 91 | |
| 92 | index += binary.PutUvarint(buf[index:], e.Meta.Timestamp) |
| 93 | index += binary.PutUvarint(buf[index:], uint64(e.Meta.KeySize)) |
| 94 | index += binary.PutUvarint(buf[index:], uint64(e.Meta.ValueSize)) |
| 95 | index += binary.PutUvarint(buf[index:], uint64(e.Meta.Flag)) |
| 96 | index += binary.PutUvarint(buf[index:], uint64(e.Meta.TTL)) |
| 97 | index += binary.PutUvarint(buf[index:], uint64(e.Meta.Status)) |
| 98 | index += binary.PutUvarint(buf[index:], uint64(e.Meta.Ds)) |
| 99 | index += binary.PutUvarint(buf[index:], e.Meta.TxID) |
| 100 | index += binary.PutUvarint(buf[index:], e.Meta.BucketId) |
| 101 | |
| 102 | return index |
| 103 | } |
| 104 | |
| 105 | // IsZero checks if the entry is zero or not. |
| 106 | func (e *Entry) IsZero() bool { |