| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Here's the official documentation.
Dare-DB is a project that provides an in-memory database utilizing Redis-inspired hashtables implemented in Go package go-redis-hashtable. It offers a lightweight and efficient solution for storing data in memory and accessing it through simple HTTP operations.
The primary goal of this project is to offer an in-memory database that leverages hashtables for efficient data storage and retrieval. The Go implementation allows using this database as a component in other Go services or integrating it into applications that require rapid access to in-memory data.
To run the database as a Docker image, ensure you have Docker installed on your system. First, navigate to the root directory of your project and execute the following command to build the Docker image:
docker build -t dare-db:latest .Once the image is built, you can run the database as a Docker container with the following command (note: a configuration option -e DARE_HOST="0.0.0.0" is explicitly set to enable connections from the host machine to the database running within the Docker container):
docker run -d -p "127.0.0.1:2605:2605" -e DARE_HOST="0.0.0.0" dare-db This command will start the database as a Docker container in detached mode, exposing port 2605 of the container to port 2605 on your localhost 127.0.0.1.
Build special Docker image, which will generate certificates
docker build -t dare-db-tls:latest -f Dockerfile.tls.yml .Once the image is built, you can run the database as a Docker container with the following command:
docker run -d -p "127.0.0.1:2605:2605" -e DARE_HOST="0.0.0.0" -e DARE_PORT=2605 -e DARE_TLS_ENABLED="True" -e DARE_CERT_PRIVATE="/app/settings/cert_private.pem" -e DARE_CERT_PUBLIC="/app/settings/cert_public.pem" dare-db-tlsAccess API over HTTPS on https://127.0.0.1:2605
The in-memory database provides three simple HTTP endpoints to interact with stored data. By default endpoints are protected by JWT:
Get the JWT token. For credentials check file: config.toml:
curl --insecure -X POST -u ADMIN:PASSWORD https://127.0.0.1:2605/login
This endpoint retrieves an item from the hashtable using a specific key.
Example usage with cURL:
curl -X GET -H "Authorization: <TOKEN>" http://127.0.0.1:2605/get/myKeyThis endpoint inserts a new item into the hashtable. The request body should contain the key and value of the new item.
Example usage with cURL:
curl -X POST -H "Authorization: <TOKEN>" -d '{"myKey":"myValue"}' http://127.0.0.1:2605/setThis endpoint deletes an item from the hashtable using a specific key.
Example usage with cURL:
curl -X DELETE -H "Authorization: <TOKEN>" http://127.0.0.1:2605/delete/myKeyA number of examples to demonstrate, how to use the database in a Go application:
A number of examples to demonstrate, how to use the database in a Python application:
For latest OpenAPI spec see: openapi
All sorts of contributions to this project! Here's how you can get involved:
How to Contribute: OverviewHere is how you could add your new code/improvement/fix with a pull request:
git clone -b develop https://github.com/dmarro89/dare-db
git checkout -b 10-implement-feature-ABC
git add .
git commit -am 'add new feature ABC'
git push origin 10-implement-feature-ABC
go install github.com/go-task/task/v3/cmd/task@latest go install github.com/bokwoon95/wgo@latestgo install github.com/evilmartians/lefthook@latest
| Back | FazBrowse Home | New Git URL |