Skip to content
This repository has been archived by the owner on Jul 8, 2024. It is now read-only.

chore: fixing readme and moving cache to its own directory #41

Merged
merged 7 commits into from
Apr 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ jobs:
services:
dragonfly:
image: docker.dragonflydb.io/dragonflydb/dragonfly
options: >-
--health-cmd "nc -z localhost 6379"
--health-interval 10s
--health-timeout 5s
--health-retries 5

keydb:
image: eqalpha/keydb
Expand Down Expand Up @@ -223,6 +228,6 @@ jobs:
sleep 120
curl -L https://go.dev/dl/go1.22.0.linux-amd64.tar.gz | tar -C /usr/local -xzf -
- name: Execute Tests
run: /usr/local/go/bin/go test -v -race -covermode=atomic -coverprofile=coverage.out ./drivers/cache
run: /usr/local/go/bin/go test -v -race -covermode=atomic -coverprofile=coverage.out ./cache
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,27 @@ Hord is designed to be a database-agnostic library that provides a common interf
- **Testing with Mock Driver**: Hord provides a mock driver in the `mock` package, which can be used for testing purposes. The `mock` driver allows users to define custom functions executed when calling the `Database` interface methods, making it easier to test code that relies on the Hord interface.
- **Documentation**: Each driver comes with its own package documentation, providing guidance on how to use and configure the driver.

### Evolving Features

- **Cache Implementations**: Combine database drivers with pre-defined cache implementations.

## Database Drivers:

| Database | Support | Comments | Protocol Compatible Alternatives |
| -------- | ------- | -------- | -------------------------------- |
| [BoltDB](https://github.com/etcd-io/bbolt) | ✅ | | |
| [Cassandra](https://cassandra.apache.org/) | ✅ | | [ScyllaDB](https://www.scylladb.com/), [YugabyteDB](https://www.yugabyte.com/), [Azure Cosmos DB](https://learn.microsoft.com/en-us/azure/cosmos-db/introduction) |
| [Couchbase](https://www.couchbase.com/) | Pending |||
| Hashmap | ✅ | Optionally allows storing to YAML or JSON file ||
| Mock | ✅ | Mock Database interactions within unit tests ||
| [NATS](https://nats.io/) | ✅ | Experimental ||
| [Redis](https://redis.io/) | ✅ || [Dragonfly](https://www.dragonflydb.io/), [KeyDB](https://docs.keydb.dev/) |

## Caching Implementations

| Cache Strategy | Comments |
| -------------- | -------- |
| Look Aside | Cache is checked before database, if not found in cache, database is checked and cache is updated |

## Usage

To use Hord, import it as follows:
Expand Down
2 changes: 1 addition & 1 deletion drivers/cache/cache.go → cache/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ import (
"errors"

"github.com/madflojo/hord"
"github.com/madflojo/hord/drivers/cache/lookaside"
"github.com/madflojo/hord/cache/lookaside"
)

// CacheType is the type of cache to use.
Expand Down
File renamed without changes.
File renamed without changes.
Loading