kemal-session-bcdb
Version, currently master branch1 version
- master branchlatestMar 13, 2024
github.com/hamdy/kemal-session-bcdb
Kemal web framework - BCDB session backend
0 stars
1 dependent
License: MIT
Installation
# Add this to your shard.yml
dependencies:
kemal-session-bcdb:
github: hamdy/kemal-session-bcdb
branch: mastermaster is a branch, not a release, so this tracks it rather than pinning a version.
Then run:
shards installshard.yml
- Crystal
0.35.1- License
- MIT
Dependencies
Runtime Dependencies
- bcdb*github: crystaluniverse/bcdb-client
- kemal-session*github: kemalcr/kemal-session, branch: master
README
kemal-session-bcdb
A BCDB store session backend for Kemalcr.com
Installation
-
Add the dependency to your
shard.yml:dependencies: kemal-session-bcdb: github: crystaluniverse/kemal-session-bcdb -
Run
shards install
How to use
Download, compile & run 0-db (Backend for BCDB)
git clone git@github.com:threefoldtech/0-db.gitcd 0-db && make./zdb --mode seq
Download, compile & run BCDB (Backend for BCDB)
- Install Rust programming language
git clone git@github.com:threefoldtech/bcdb.gitcd bcdb && make- copy bcdb binary anywhere
cp bcdb/target/x86_64-unknown-linux-musl/release/bcdb . - download
tfuserutility from here - use
tfuserto register your 3bot user to explorer and generate seed fileusr.seedusing./tfuser id create --name {3bot_username.3bot} --email {email} - run bcdb :
./bcdb --seed-file user.seed - now you can talk to
bcdbthrough http via unix socket/tmp/bcdb.sock
Usage (Kemal.rc example)
require "kemal"
require "kemal-session"
require "kemal-session-bcdb"
Kemal::Session.config do |config|
config.cookie_name = "redis_test"
config.secret = "a_secret"
config.engine = Kemal::Session::BcdbEngine.new(unixsocket= "/tmp/bcdb.sock", namespace = "kemal_sessions", key_prefix = "kemal:session:")
config.timeout = Time::Span.new hours: 0, minutes: 0, seconds: 20
end
get "/set" do |env|
env.session.int("number", rand(100)) # set the value of "number"
"Random number set."
end
get "/get" do |env|
num = env.session.int?("number") # get the value of "number"
env.session.int?("hello") # get value or nil, like []?
"Value of random number is #{num}."
end
get "/destroy" do |env|
env.session.destroy
num = env.session.int?("number")
env.session.int?("hello") # get value or nil, like []?
"Value of random number is #{num}."
end
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This branch
- Branch
master- Seen
- Mar 13, 2024
- Crystal
0.35.1- Indexed
- yes
Dependents
Repository
github.com/hamdy/kemal-session-bcdb
Metadata
- Created
- Aug 19, 2026
- Updated
- Nov 7, 2026
- Synced
- Nov 7, 2026
- Versions
- 1