Session to store as ledis local files.
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 7a09222521
Fix bug
1 month ago
.drone.yml init project 1 year ago
.gitignore init project 1 year ago
LICENSE init project 1 year ago
README.md Fix readme 1 year ago
go.mod Implement new method Keys of Session 1 year ago
go.sum Implement new method Keys of Session 1 year ago
ledis_local.go Fix bug 1 month ago
ledis_local_test.go Implement new method Keys of Session 1 year ago

README.md

session-ledis-local Build Status

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

Installation

go get gitea.com/tango/session-ledis-local

Simple Example

package main

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

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()
    store, _ := ledislocal.New(ledislocal.Options{
        Path:    "./ledis_store",
        DBIndex: 0,
        MaxAge:  30 * time.Minute,
    })
    o.Use(session.New(session.Options{
        Store: store,
        }))
    o.Get("/", new(SessionAction))
}

Getting Help