cmd

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const Version string = "v1.0.5"

Variables

View Source
var (
	Snapshot      = "path/to/snapshot"
	LogPath       = "path/to/log"
	HmacKey       = []byte("32-byte-hmac-key")
	EncryptionKey = []byte("32-byte-long-encryption-key")
	Nonce         = []byte("24-byte-nonce")
	KeySize       = 32  // XChaCha20 key size
	NonceSize     = 24  // XChaCha20 nonce size
	CacheSize     = 100 // Set a default cache size for B-tree nodes
)

Functions

func DeleteKey added in v1.0.5

func DeleteKey(btree *kayveedb.BTree, key string) error

DeleteKey deletes a key from the B-tree.

func Execute

func Execute()

func InitializeKeys added in v1.0.5

func InitializeKeys() error

InitializeKeys initializes the keys from environment variables or errors out.

func InsertKey added in v1.0.5

func InsertKey(btree *kayveedb.BTree, key, value string) error

InsertKey inserts a new key-value pair into the B-tree.

func LoadBtree added in v1.0.5

func LoadBtree() (*kayveedb.BTree, error)

LoadBtree loads the B-tree from the snapshot and logs.

func LoadConfig added in v1.0.5

func LoadConfig()

LoadConfig loads the config file and environment variables.

func ReadKey added in v1.0.5

func ReadKey(btree *kayveedb.BTree, key string) (string, error)

ReadKey reads the value of a key from the B-tree.

func SnapshotBtree added in v1.0.5

func SnapshotBtree(btree *kayveedb.BTree) error

SnapshotBtree takes a snapshot of the current B-tree state.

func UpdateKey added in v1.0.5

func UpdateKey(btree *kayveedb.BTree, key, value string) error

UpdateKey updates an existing key-value pair in the B-tree.

func ValidateEncryptionParams added in v1.0.5

func ValidateEncryptionParams() error

ValidateEncryptionParams validates the encryption key and nonce.

Types

This section is empty.

Jump to

Keyboard shortcuts

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