https://github.com/reddec/envredis
Map environment to/from redis
https://github.com/reddec/envredis
interceptor redis syscall-hook
Last synced: about 1 month ago
JSON representation
Map environment to/from redis
- Host: GitHub
- URL: https://github.com/reddec/envredis
- Owner: reddec
- Created: 2017-12-14T17:19:29.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2020-10-26T10:10:22.000Z (over 5 years ago)
- Last Synced: 2025-03-09T00:06:39.075Z (over 1 year ago)
- Topics: interceptor, redis, syscall-hook
- Language: C
- Size: 5.86 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# EnvRedis

Wrap syscall for get/set/clean and e.t.c environment and map values to/from Redis
# Requirements
- libhiredis (tested on 0.13)
- C11
# Environment variable
* **ENVREDIS_IP** - ip of redis server. Default: `127.0.0.1`
* **ENVREDIS_PORT** - port of redis server. Default: `6379`
* **ENVREDIS_PREFIX** - prefix for each keys. Default: nothing
* **ENVREDIS_PANIC** - fail if redis operations failed. Disabled by default
# Sample usage
## Local
export LD_PRELOAD=/path/to/libenvredis.so
python -c 'import os; os.environ["MY_SAMPLE_VAR"]="111"'
python -c 'import os; print os.environ["MY_SAMPLE_VAR"]'
## Remote
export LD_PRELOAD=/path/to/libenvredis.so
export ENVREDIS_IP='xx.yy.zz.cc'
python -c 'import os; os.environ["MY_SAMPLE_VAR"]="111"'
python -c 'import os; print os.environ["MY_SAMPLE_VAR"]'