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.
|
2 years ago | |
---|---|---|
.drone.yml | 3 years ago | |
.gitignore | 2 years ago | |
README.md | 3 years ago | |
go.mod | 2 years ago | |
go.sum | 2 years ago | |
nodb.go | 2 years ago | |
nodb_test.go | 2 years ago |
README.md
session-nodb

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))
}