Skip to content

Commit 549260c

Browse files
committed
docs: add docs for the level db adapter and add adapter in install-adapters.sh
1 parent 2201e07 commit 549260c

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

adapters/install-adapters.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ adminforth-facebook-oauth-adapter adminforth-keycloak-oauth-adapter adminforth-m
55
adminforth-twitch-oauth-adapter adminforth-image-generation-adapter-openai adminforth-storage-adapter-amazon-s3 \
66
adminforth-storage-adapter-local adminforth-image-vision-adapter-openai adminforth-key-value-adapter-ram \
77
adminforth-login-captcha-adapter-cloudflare adminforth-login-captcha-adapter-recaptcha adminforth-completion-adapter-google-gemini \
8-
adminforth-key-value-adapter-redis"
8+
adminforth-key-value-adapter-redis adminforth-key-value-adapter-leveldb"
99

1010
# for each
1111
install_adapter() {

adminforth/documentation/docs/tutorial/05-ListOfAdapters.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,26 @@ const adapter = new RedisKeyValueAdapter({
264264
redisUrl: '127.0.0.1:6379'
265265
})
266266

267-
adapeter.set('test-key', 'test-value', 120);
267+
adapeter.set('test-key', 'test-value', 120); //expiry in 120 seconds
268+
269+
```
270+
271+
### LevelDB adapter
272+
273+
```bash
274+
npm i @adminforth/key-value-adapter-leveldb
275+
```
276+
277+
LebelDB uses local storage for storing keys.
278+
279+
```ts
280+
import LevelDBKeyValueAdapter from '@adminforth/key-value-adapter-leveldb'
281+
282+
const adapter = new LevelDBKeyValueAdapter({
283+
dbPath: './testdb'
284+
});
285+
286+
adapeter.set('test-key', 'test-value', 120); //expiry in 120 seconds
268287

269288
```
270289

0 commit comments

Comments
 (0)