Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/boxgo/redisstore
A session store backend for gorilla/sessions
https://github.com/boxgo/redisstore
gorilla gorilla-sessions
Last synced: 9 days ago
JSON representation
A session store backend for gorilla/sessions
- Host: GitHub
- URL: https://github.com/boxgo/redisstore
- Owner: boxgo
- License: mit
- Created: 2020-04-29T04:13:42.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-03-04T01:31:35.000Z (almost 4 years ago)
- Last Synced: 2024-11-06T07:07:55.545Z (about 2 months ago)
- Topics: gorilla, gorilla-sessions
- Language: Go
- Homepage:
- Size: 18.6 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[doc-img]: https://godoc.org/github.com/boxgo/redisstore?status.svg
[doc-url]: https://pkg.go.dev/github.com/boxgo/redisstore?tab=doc
[travis-img]: https://travis-ci.com/boxgo/redisstore.svg?branch=master
[travis-url]: https://travis-ci.com/boxgo/redisstore?branch=master
[coverage-img]: https://coveralls.io/repos/github/boxgo/redisstore/badge.svg?branch=master
[coverage-url]: https://coveralls.io/github/boxgo/redisstore?branch=master
[report-img]: https://goreportcard.com/badge/github.com/boxgo/redisstore
[report-url]: https://goreportcard.com/report/github.com/boxgo/redisstore# redisstore
[![GoDoc][doc-img]][doc-url]
[![Build Status][travis-img]][travis-url]
[![Coverage Status][coverage-img]][coverage-url]
[![Go Report Card][report-img]][report-url]A session store backend for [gorilla/sessions](http://www.gorillatoolkit.org/pkg/sessions) - [src](https://github.com/gorilla/sessions).
## Features
* Support Redis Sentinel, Cluster, Standalone
* Support secure cookie
* Support json, gob serializer or custom serializer
* Support `MaxLength`, `KeyPrefix` and `KeyGenFunc` options## Installation
```sh
go get github.com/boxgo/redisstore
```## Requirements
Depends on the [go-redis/redis](https://github.com/go-redis/redis) Redis library.### Example
``` go
client := redis.NewUniversalClient(&redis.UniversalOptions{
Addrs: []string{"localhost:6379"},
DB: 0,
})store, err := NewStoreWithUniversalClient(client,
WithKeyPairs([]byte("test")),
WithKeyPrefix("session_"),
WithSerializer(&serializer.JSONSerializer{}),
)
```