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 | 6 years ago | |
LICENSE | 7 years ago | |
README.md | 3 years ago | |
circle.yml | 5 years ago | |
generator.go | 7 years ago | |
go.mod | 3 years ago | |
go.sum | 3 years ago | |
memorystore.go | 2 years ago | |
session.go | 2 years ago | |
session_test.go | 2 years ago | |
sessions.go | 3 years ago | |
store.go | 2 years ago | |
tracker.go | 7 years ago |
README.md
session

Session is a session middleware for Tango.
Backend Supports
Currently session support some backends below:
- Memory - memory as a session store, this is the default store
- nodb - nodb as a session store
- redis - redis server as a session store
- ledis - ledis server as a session store
- ssdb - ssdb server as a session store
Installation
go get gitea.com/tango/session
Simple Example
package main
import (
"gitea.com/lunny/tango"
"gitea.com/tango/session"
)
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{
MaxAge:time.Minute * 20,
}))
o.Get("/", new(SessionAction))
}
Getting Help
License
This project is under BSD License. See the LICENSE file for the full license text.