Licence
MIT
Version
0.1.0
Deps
1
Size
27 kB
Vulns
0
Weekly
0
@xfcfam/xf-kv-redis
Redis adapter for
@xfcfam/xf-kv— theKeyValueRepositorycontract overioredis.
ioredisis bundled and wired internally — you never import it. Name your concrete class by domain (SessionRepository), not by technology.
Install
npm i @xfcfam/xf @xfcfam/xf-kv @xfcfam/xf-kv-redisQuick start
import { RedisKeyValueRepository } from '@xfcfam/xf-kv-redis'
export class SessionRepository extends RedisKeyValueRepository<Session> {
constructor() { super({ url: process.env.REDIS_URL, namespace: 'sess', defaultTtl: 3600 }) }
}Exported Components
Generalizations
| Component | Description |
|---|---|
RedisKeyValueRepository<V> |
Backs the contract with native Redis commands — GET · SET … EX · DEL · EXISTS · INCRBY · MGET · pipelined SET · TTL · SCAN+DEL. |
Utilities
| Component | Description |
|---|---|
RedisErrorUtils |
Maps transport codes (ECONNREFUSED, …) to ConnectionException. |
Full TTL introspection and namespace-scoped
clear()are supported (unlike the Memcached adapter). Passurl, or a fullioredisoptions object viaredis.
Documentation
Full specification → xfcfam.org
License
MIT