Kelvin Mwinuka
54d0ae700a
Removed Opts from echovault. NewEchoVault now entirely uses the option pattern
2024-03-25 17:22:18 +08:00
Kelvin Mwinuka
ba2ebaa6da
Renamed 'server' package to 'echovault'
2024-03-25 16:26:09 +08:00
Kelvin Mwinuka
93cfb9caeb
Renames Server struct and utils.Server interface to EchoVault and utils.EchoVault respectively
2024-03-25 16:23:16 +08:00
Kelvin Mwinuka
4bc1f44e1d
Added Apache 2.0 license header to all go files in src folder
2024-03-24 18:30:17 +08:00
Kelvin Mwinuka
e685d5041b
Updated test suites to set mock server only once in each suite instead of instantiating it in every test.
2024-03-15 03:44:42 +08:00
Kelvin Mwinuka
c414da16b4
KeyExists keyspace function now removes the key if the key expiry is in the past.
...
KeyData type moved to utils package to allow sharing between multiple packages.
Updated all commands and command tests to pass context object to KeyExists, KeyLock, keyUnlock, KeyRLock, and KeyRUnlock.
Create context object for each test in all test suites instead of just passing context.Background() to all functions that accept a context.
2024-03-10 23:19:05 +08:00
Kelvin Mwinuka
82be1f6068
Added addedTime to EntryLFU object to control which entry will be removed if access count is the same. If two entries have the same access count, the older entry should be removed first.
...
SetKeyExpiry and GetValue keyspace receiver functions now require context object to be passed.
Created adjustMemoryUsage function for key eviction for LFU, LRU, and Random eviction policies.
Updated all modules to pass context to SetKeyExpirty and GetValue functions.
2024-03-08 00:26:49 +08:00
Kelvin Clement Mwinuka
e569bf6837
Added config flags max-memory and eviction-policy to manage memory usage. Created ParseMemory utility function to parse max-memory value into bytes. Created LFU cache to be used with heap data structure for managing LFU cache.
2024-03-01 16:25:04 +08:00
Kelvin Clement Mwinuka
5bb7d19953
Added tests for handleSubStr handler
2024-02-14 18:49:35 +08:00
Kelvin Clement Mwinuka
c370833e33
Added tests for handleStrLen function
2024-02-14 16:16:17 +08:00
Kelvin Clement Mwinuka
42d9bf11a1
Updated handleSetRange logic and added some test cases.
2024-02-14 16:01:11 +08:00
Kelvin Clement Mwinuka
7356cf34f5
Created test file for string commands
2024-02-13 11:29:42 +08:00
Kelvin Clement Mwinuka
fc6d81fa4a
Created test file for string module
2024-02-12 21:20:22 +08:00