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

Commit

Permalink
Merge pull request #41 from madflojo/minorstuff
Browse files Browse the repository at this point in the history
chore: fixing readme and moving cache to its own directory
  • Loading branch information
madflojo authored Apr 14, 2024
2 parents 8b0c926 + 54f796e commit c3e4063
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 3 deletions.
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.
File renamed without changes.

0 comments on commit c3e4063

Please sign in to comment.