Documentation ¶
Overview ¶
Package arc implements a key-value database based on a Radix tree data structure and deduplication-enabled blob storage. The Radix tree provides space-efficient key management through prefix compression, while the blob storage handles values with automatic deduplication.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrCorrupted is returned when a database corruption is detected. ErrCorrupted = errors.New("database corruption detected") // ErrDuplicateKey is returned when an insertion is attempted using a // key that already exists in the database. ErrDuplicateKey = errors.New("cannot insert duplicate key") // ErrInvalidChecksum is returned when the node checksum is invalid. ErrInvalidChecksum = errors.New("invalid checksum detected") // ErrKeyNotFound is returned when the key does not exist in the index. ErrKeyNotFound = errors.New("key not found") // ErrKeyTooLarge is returned when the key size exceeds the 64KB limit. ErrKeyTooLarge = errors.New("key is too large") // ErrNilKey is returned when an insertion is attempted using a nil key. ErrNilKey = errors.New("key cannot be nil") // ErrNodeCorrupted is returned when an index node corruption is detected. ErrNodeCorrupted = errors.New("index node corruption detected") // ErrValueTooLarge is returned when the value size exceeds the 4GB limit. ErrValueTooLarge = errors.New("value is too large") )
Functions ¶
This section is empty.
Types ¶
type Arc ¶
type Arc struct {
// contains filtered or unexported fields
}
Arc represents the API interface of a space-efficient key-value database that combines a Radix tree for key indexing and a space-optimized blob store.
func (*Arc) Add ¶
Add inserts a new key-value pair in the database. It returns ErrDuplicateKey if the key already exists.
func (*Arc) DebugPrint ¶
func (a *Arc) DebugPrint()
DebugPrint prints the Arc index structure in a directory tree format. Use this function only for development and debugging purposes.