Documentation
¶
Index ¶
Constants ¶
View Source
const ( // MinHeaderSize is the minimum header size when no extra blocks are present MinHeaderSize = 24 // PreAllocSize is the number of bytes pre-allocated to fit a header // with extensions. Larger headers will trigger an additional heap alloc. PreAllocSize = 64 // BlockSize is the number of bytes per extra block BlockSize = 8 )
View Source
const ( VersionOffset = 16 FlagsOffset = 17 NumExtraOffsetHigh = 22 // uint16 high byte NumExtraOffsetLow = 23 // uint16 low byte )
Variables ¶
View Source
var ( ErrTooShort = errors.New("value too short to contain a header") ErrVersion = errors.New("unsupported header version or not a header") )
Functions ¶
Types ¶
type Flags ¶
type Flags uint8
const ( // FlagDeleted indicates that this entry has been deleted FlagDeleted Flags = 1 // NoFlags can be used when no flags are needed, for readability NoFlags Flags = 0 // FlagSyncMask is the mask of flags allowed to sync to/from a snapshot, // others will be cleared. FlagSyncMask = FlagDeleted )
type Header ¶
type Header struct { Timestamp Timestamp // time of last change TxnID TxnID // lmdb Go lib uses uint64 and uintptr Version int // header version (currently always 0) Flags Flags // header flags NumExtra int // extra number of 8-byte blocks (set automatically in .Bytes()) Extra []byte // bytes in extra block }
Header describes the header of a native schema value
func (Header) MarshalBinary ¶
type Timestamp ¶
type Timestamp uint64
Timestamp is the number of nanoseconds since the UNIX epoch, which is how we write it to the header.
func ParseTimestamp ¶
ParseTimestamp parses a timestamp from the first 8 bytes of the value
func TimestampFromTime ¶
TimestampFromTime creates a Timestamp from a Time
Click to show internal directories.
Click to hide internal directories.