Skip to content

Commit

Permalink
Add Postgres session store.
Browse files Browse the repository at this point in the history
  • Loading branch information
knadh committed May 15, 2024
1 parent 6ce940f commit d3e0457
Show file tree
Hide file tree
Showing 5 changed files with 527 additions and 4 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,17 @@ Most session libraries are highly opinionated and hard-wired to work with `net/h
## Features
1. Framework/network library agnostic.
2. Simple API and with support for primitive data types. Complex types can be stored using own encoding/decoding.
3. Bundled Redis and in-memory stores.
3. Pre-built redis/postgres/in-memory stores that can be separately installed.
4. Multiple session instances with custom handlers and different backend stores.

## Installation
Install `simplesessions` and all [available stores](/stores).

```
```shell
go get -u github.com/vividvilla/simplesessions
go get -u github.com/vividvilla/simplesessions/stores/...

# Install the requrired store: memory|goredis|redis|postgres
go get -u github.com/vividvilla/simplesessions/stores/goredis
```

# Stores
Expand Down
3 changes: 2 additions & 1 deletion go.work
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
go 1.21
go 1.14

use (
.
Expand All @@ -7,4 +7,5 @@ use (
./stores/memory
./stores/redis
./stores/securecookie
./stores/postgres
)
5 changes: 5 additions & 0 deletions stores/postgres/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module github.com/vividvilla/simplesessions/stores/postgres

go 1.14

require github.com/lib/pq v1.10.9
Loading

0 comments on commit d3e0457

Please sign in to comment.