feat: Add OurDB key-value store server

- Adds a new lightweight key-value store server implemented in V.
- Includes basic CRUD operations (`set`, `get`, `delete`).
- Provides configurable host and operation restrictions for security.
- Offers middleware for logging and request validation.
- Supports incremental mode for automatic ID generation.
- Includes comprehensive documentation and example usage.
- Adds unit tests to ensure functionality and stability.
This commit is contained in:
Mahmoud Emad
2025-03-05 23:02:35 +02:00
parent fdf540cbd0
commit ae7e7ecb84
4 changed files with 400 additions and 0 deletions

17
examples/data/ourdb_server.vsh Executable file
View File

@@ -0,0 +1,17 @@
#!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run
import freeflowuniverse.herolib.data.ourdb
import os
mut server := ourdb.new_server(
port: 9000
allowed_hosts: ['localhost']
allowed_operations: ['set', 'get', 'delete']
secret_key: 'secret'
config: ourdb.OurDBConfig{
path: '/tmp/ourdb'
incremental_mode: true
}
)!
server.run()