An open API service indexing awesome lists of open source software.

https://github.com/hyper63/hyper-adapter-redis

Redis adapter for Hyper Cache port
https://github.com/hyper63/hyper-adapter-redis

cache clean-architecture deno hyper ports-and-adapters redis service-framework

Last synced: 7 months ago
JSON representation

Redis adapter for Hyper Cache port

Awesome Lists containing this project

README

          

hyper-adapter-redis


A Cache port adapter for Redis in the hyper service framework


Test
Current Version

---

- [Getting Started](#getting-started)
- [Installation](#installation)
- [Features](#features)
- [Methods](#methods)
- [Contributing](#contributing)
- [Testing](#testing)
- [License](#license)

## Getting Started

```js
import { default as redis } from 'https://raw.githubusercontent.com/hyper63/hyper-adapter-redis/v3.1.0/mod.js'

export default {
app: opine,
adapter: [
{
port: 'cache',
plugins: [
redis({ url: 'http://user@password@redis.host:6379' }),
],
},
],
}
```

You can also pass a separate `hostname` and `port` to the adapter:

```js
redis({ hostname: 'redis.host', port: 6380 }),
```

> `port` will always default to `6379` if not provided, then `443` if the `url` protocol is `https`
> then finally `80`

To connect to a Redis Cluster, pass the `cluster` flag:

```js
redis({ url: 'http://user@password@redis.host:6379', cluster: true })
```

The adapter will automatically discover all nodes in the Cluster.

## Installation

deps.js

```js
export { default as redis } from 'https://raw.githubusercontent.com/hyper63/hyper-adapter-redis/v3.1.0/mod.js'
```

## Features

- Create a named store in `Redis`
- Destroy a named store in `Redis`
- Create a document in a store in `Redis`
- Get a document from a store in `Redis`
- Update a document in a store in `Redis`
- Delete a document from a store in `Redis`
- List documents in a sttore in `Redis`

## Methods

This adapter fully implements the Search port and can be used as the
[hyper Cache service](https://docs.hyper.io/cache-api) adapter

See the full port [here](https://nest.land/package/hyper-port-cache)

## Contributing

Contributions are welcome! See the hyper
[contribution guide](https://docs.hyper.io/oss/contributing-to-hyper)

## Testing

```
deno task test
```

To lint, check formatting, and run unit tests

## License

Apache-2.0