Skip to content

reddec/envredis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EnvRedis

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"]'

Releases

No releases published

Packages

No packages published