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
- Host: GitHub
- URL: https://github.com/hyper63/hyper-adapter-redis
- Owner: hyper63
- License: apache-2.0
- Created: 2021-06-17T16:53:47.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2024-01-19T01:02:49.000Z (over 1 year ago)
- Last Synced: 2025-01-13T05:41:39.475Z (9 months ago)
- Topics: cache, clean-architecture, deno, hyper, ports-and-adapters, redis, service-framework
- Language: JavaScript
- Homepage:
- Size: 237 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
hyper-adapter-redis
A Cache port adapter for Redis in the hyper service framework
---
- [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) adapterSee 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