|
6 months ago | |
---|---|---|
.drone.yml | 6 months ago | |
LICENSE | 4 years ago | |
README.md | 6 months ago | |
circle.yml | 2 years ago | |
flash.go | 8 months ago | |
flash_test.go | 8 months ago | |
go.mod | 6 months ago | |
go.sum | 6 months ago |
Middleware flash is a tool for share data between requests for Tango.
This is a new version, it stores all data via session not cookie. And it is slightly non-compitable with old version.
go get gitea.com/tango/flash
import "gitea.com/tango/session"
type FlashAction struct {
flash.Flash
}
func (x *FlashAction) Get() {
x.Flash.Set("test", "test")
}
func (x *FlashAction) Post() {
x.Flash.Get("test").(string) == "test"
}
func main() {
t := tango.Classic()
sessions := session.Sessions()
t.Use(flash.Flashes(sessions))
t.Any("/", new(FlashAction))
t.Run()
}
This project is under BSD License. See the LICENSE file for the full license text.