MCPcopy Create free account
hub / github.com/nutsdb/nutsdb / setEntryHeaderBuf

Method setEntryHeaderBuf

internal/core/entry.go:89–103  ·  view source on GitHub ↗

setEntryHeaderBuf sets the entry header buff.

(buf []byte)

Source from the content-addressed store, hash-verified

87
88// setEntryHeaderBuf sets the entry header buff.
89func (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.
106func (e *Entry) IsZero() bool {

Callers 1

EncodeMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected