record

package
v0.0.0-...-251bb73 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 1, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	V1_CRC_SIZE    = 4 // CRC Size
	V1_TS_SIZE     = 8 // Timestamp Size
	V1_KS_SIZE     = 4 // Key Size
	V1_VS_SIZE     = 8 // Value Size
	V1_DF_SIZE     = 1 // Delete Flag Size
	V1_RECORD_SIZE = VER_SIZE + V1_CRC_SIZE + V1_TS_SIZE + V1_KS_SIZE + V1_VS_SIZE + V1_DF_SIZE

	V1_VERSION = 0x0       // Version 0000
	V1_DELETE  = byte(0x1) // delete flag 0001
)

V1 RECORD

View Source
const VER_SIZE = 1 // Version Size

Variables

This section is empty.

Functions

This section is empty.

Types

type Record

type Record interface {
	ValueRelativePosition() int64
	ValueSize() int64
	Key() string
	Value() string
	Timestamp() int64
	ToBytes() ([]byte, error)
	Len() int64
	SetMeta(fileName string, offset int64)
}

func NewDeleteRecord

func NewDeleteRecord(key string) (Record, error)

func NewRecord

func NewRecord(key string, value string) (Record, error)

func ParseRecord

func ParseRecord(reader io.Reader) (Record, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL