Skip to content

hyper63/hyper-adapter-redis

Repository files navigation

hyper-adapter-redis

A Cache port adapter for Redis in the hyper service framework

Test Current Version


Getting Started

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:

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:

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

The adapter will automatically discover all nodes in the Cluster.

Installation

deps.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 adapter

See the full port here

Contributing

Contributions are welcome! See the hyper contribution guide

Testing

deno task test

To lint, check formatting, and run unit tests

License

Apache-2.0