redis store for session
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Lunny Xiao 54d5e6b68f bug fixed 3 years ago
LICENSE BSD LICENSE 4 years ago
README.md bug fixed 3 years ago
redis.go bug fixed 3 years ago
redis_test.go BSD LICENSE 4 years ago

README.md

session-redis Build Status

Session-redis is a store of session middleware for Tango stored session data via redis.

Installation

go get github.com/tango-contrib/session-redis

Simple Example

package main

import (
    "github.com/lunny/tango"
    "github.com/tango-contrib/session"
    "github.com/tango-contrib/session-redis"
)

type SessionAction struct {
    session.Session
}

func (a *SessionAction) Get() string {
    a.Session.Set("test", "1")
    return a.Session.Get("test").(string)
}

func main() {
    o := tango.Classic()
    o.Use(session.New(session.Options{
        Store: redistore.New(redistore.Options{
                Host:    "127.0.0.1",
                DbIndex: 0,
                MaxAge:  30 * time.Minute,
            }),
        }))
    o.Get("/", new(SessionAction))
}

Getting Help

License

This project is under BSD License. See the LICENSE file for the full license text.