Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nitrogen/canister
Distributed session manager for Erlang (used by Nitrogen Web Framework)
https://github.com/nitrogen/canister
distributed-systems erlang session-management
Last synced: 2 months ago
JSON representation
Distributed session manager for Erlang (used by Nitrogen Web Framework)
- Host: GitHub
- URL: https://github.com/nitrogen/canister
- Owner: nitrogen
- License: mit
- Created: 2021-12-15T16:06:31.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2024-04-10T20:08:21.000Z (10 months ago)
- Last Synced: 2024-09-20T13:37:39.811Z (4 months ago)
- Topics: distributed-systems, erlang, session-management
- Language: Erlang
- Homepage: https://nitrogenproject.com
- Size: 50.8 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Canister
An Erlang Session Management system
The standard session management system for [Nitrogen](https://nitrogenproject.com)
## Features
* Data Persistence (stored in mnesia)
* Data is replicated across all connected node
* Automatic self-healing in the event of split brain, new nodes being added to the cluster, and more.
* Expired sessions automatically deleted accordingly## Include the dependency
Add as a rebar dependency in your rebar.config
```erlang
{deps, [canister]}.
```## Start It
Put it in your `app.src` file or start it explicitly with:
```
application:ensure_all_started(canister).
```## Functionality
### Save a Session Variable
```erlang
canister:put(SessionID, Key, Value).
```Returns: Previously stored `Value` or `undefined`
### Retrieving a Session Variable
```erlang
canister:get(SessionID, Key).
```Returns: `Value` or `undefined`
### Inspecting specific Session Info
```erlang
canister:session_info(SessionID).
```Retrieves all data variables as well as relevant dates and times: when it was last accessed, updated, or deleted
## Configuration
See [canister.config](https://github.com/nitrogen/canister/blob/master/src/canister_config.erl) for explanation of configuration variables.
**Note**: `session_timeout` variable will also check the `nitrogen` and `nitrogen_core` app configs, just in case.
## License
Copyright 2022 Jesse Gumm
[MIT Licensed](https://github.com/nitrogen/canister/blob/master/LICENSE)