Skip to content

Commit

Permalink
Fixed lint errors on README (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
f0rmiga authored Nov 22, 2018
1 parent c5abe40 commit e35e938
Showing 1 changed file with 33 additions and 25 deletions.
58 changes: 33 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,16 @@ To know more about Redis modules, follow this [link](http://antirez.com/news/106
The module is written in C and uses Bazel to build. Bazel manages all the dependencies. :D

The dependencies are:

- [Redis Modules SDK](https://github.com/RedisLabs/RedisModulesSDK)
- [Sodium crypto library (libsodium)](https://download.libsodium.org/doc/)

### Building on Linux/OS X

Run:

```
$ bazel build //...
```txt
bazel build //...
```

### Building on Windows
Expand All @@ -47,28 +48,29 @@ $ bazel build //...
Tests are located under `tests/` directory and are written in Python. You should have Python 2.7+
installed in order to run the tests. Run:

```
$ bazel test //...
```txt
bazel test //...
```

For verbose tests run:

```
$ bazel test --test_output=all //...
```txt
bazel test --test_output=all //...
```

## Loading the module for use

The module can be loaded in Redis 4+. The most convenient way to do that is by passing --loadmodule
parameter when starting the Redis server:

```
$ redis-server --loadmodule <path_to_sessiongate.so>
```txt
redis-server --loadmodule <path_to_sessiongate.so>
```

For example, starting Redis open to the world and the Session Gate loaded:
```
$ redis-server --protected-mode no --loadmodule $(pwd)/bazel-bin/sessiongate.so

```txt
redis-server --protected-mode no --loadmodule $(pwd)/bazel-bin/sessiongate.so
```

Just make sure to pass the right `sessiongate.so` path value to the --loadmodule parameter.
Expand All @@ -81,10 +83,11 @@ Command: `SESSIONGATE.START <sign_key> <ttl>`

- `<sign_key>` is the secret string used by the HMAC algorithm to generate the token signature.
- `<ttl>` is the positive integer that represents the seconds that the session will live. If set to
0, the session expires immediately.
0, the session expires immediately.

##### Example
```
#### Example

```txt
SESSIONGATE.START 'qwerty' 300
```

Expand All @@ -97,10 +100,11 @@ Command: `SESSIONGATE.EXPIRE <sign_key> <token> <ttl>`
- `<sign_key>` is the secret string used by the HMAC algorithm to verify the token signature.
- `<token>` is the token returned by the START command.
- `<ttl>` is the positive integer that represents the seconds that the session will live. If set to
0, the session expires immediately.
0, the session expires immediately.

##### Example
```
#### Example

```txt
SESSIONGATE.EXPIRE 'qwerty' <token> 300
```

Expand All @@ -114,10 +118,11 @@ Command: `SESSIONGATE.PSET <sign_key> <token> <payload_name> <payload_data>`
- `<token>` is the token returned by the START command.
- `<payload_name>` is the payload name that is used to identify the payload data.
- `<payload_data>` is the payload data. It can be any string, for example, a JSON stringified
object.
object.

##### Example
```
#### Example

```txt
SESSIONGATE.PSET 'qwerty' <token> 'user' '{"name":"John Doe"}'
```

Expand All @@ -131,8 +136,9 @@ Command: `SESSIONGATE.PGET <sign_key> <token> <payload_name>`
- `<token>` is the token returned by the START command.
- `<payload_name>` is the payload name that is used to retrieve the payload data.

##### Example
```
#### Example

```txt
SESSIONGATE.PGET 'qwerty' <token> 'user'
```

Expand All @@ -146,8 +152,9 @@ Command: `SESSIONGATE.PDEL <sign_key> <token> <payload_name>`
- `<token>` is the token returned by the START command.
- `<payload_name>` is the payload name that is used to identify the payload data being deleted.

##### Example
```
#### Example

```txt
SESSIONGATE.PDEL 'qwerty' <token> 'user'
```

Expand All @@ -160,8 +167,9 @@ Command: `SESSIONGATE.END <sign_key> <token>`
- `<sign_key>` is the secret string used by the HMAC algorithm to verify the token signature.
- `<token>` is the token returned by the START command.

##### Example
```
#### Example

```txt
SESSIONGATE.END 'qwerty' <token>
```

Expand Down

0 comments on commit e35e938

Please sign in to comment.