nodb 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 7c186000e8
Implement new method Keys of Session
3 weeks ago
.drone.yml go mod support 1 year ago
.gitignore Implement new method Keys of Session 3 weeks ago
README.md go mod support 1 year ago
go.mod Implement new method Keys of Session 3 weeks ago
go.sum Implement new method Keys of Session 3 weeks ago
nodb.go Implement new method Keys of Session 3 weeks ago
nodb_test.go Implement new method Keys of Session 3 weeks ago

README.md

session-nodb Build Status

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

Installation

go get gitea.com/tango/session-nodb

Simple Example

package main

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

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

Getting Help