Versions in this module Expand all Collapse all v0 v0.1.1 Nov 19, 2023 Changes in this version + const ExpireSize + const HeaderSize + const KeyLenSize + const SizePowerSize + const StatusDeleted + const StatusOK + const StatusOffset + const StatusSize + const ValLenSize + func NextNumberOfPowerOfTwo[V int | int32 | int64](value V) (byte, V) + func NextPowerOfTwo[V int | int32 | int64](value V) V + type Buffer struct + func NewBuffer(size int) *Buffer + func (b *Buffer) Bytes() []byte + func (b *Buffer) WriteHeader(h Header) + func (b *Buffer) WriteKey(key []byte) + func (b *Buffer) WriteValue(val []byte) + type Header struct + Expire uint32 + KeyLen uint16 + SizePower byte + Status Status + ValLen uint32 + func UnmarshalHeader(buffer []byte) Header + func (h Header) IsExpired(now time.Time) bool + func (h Header) Size() int + type KVE struct + Expire uint32 + Key []byte + Value []byte + func Unmarshal(buffer []byte) KVE + func UnmarshalBody(buffer []byte, header Header) KVE + func (kve KVE) IsExpired(now time.Time) bool + func (kve KVE) Marshal() (_ []byte, nextPowerOfTwo int) + type Status byte v0.1.0 Nov 18, 2023