ledis 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 938d71aa10
Implement new method Keys of Session
3 weeks ago
.gitignore Implement new method Keys of Session 3 weeks ago
README.md Implement new method Keys of Session 3 weeks ago
go.mod Implement new method Keys of Session 3 weeks ago
go.sum Implement new method Keys of Session 3 weeks ago
ledis.go Implement new method Keys of Session 3 weeks ago
ledis_test.go Implement new method Keys of Session 3 weeks ago

README.md

session-ledis Build Status

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

Installation

go get gitea.com/tango/session-ledis

Simple Example

package main

import (
    "gitea.com/lunny/tango"
    "gitea.com/tango/session"
    "gitea.com/tango/session-ledis"
)

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(ledistore.Options{
                Host:    "127.0.0.1",
                DbIndex: 0,
                MaxAge:  30 * time.Minute,
            }),
        }))
    o.Get("/", new(SessionAction))
}

Getting Help