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 e98a6dd2b4
update dependency packages
1 month ago
.drone.yml go mod support 1 month ago
.gitignore bug fix 1 year ago
README.md go mod support 1 month ago
go.mod update dependency packages 1 month ago
go.sum update dependency packages 1 month ago
nodb.go update dependency packages 1 month ago
nodb_test.go migrate to gitea.com/lunny/tango 8 months 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