Session support for tango
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 87f6e468e4
Session新增Keys方法,返回所有的Keys
11 months ago
.drone.yml add drone 2 years ago
.gitignore bug fixed 5 years ago
LICENSE license 6 years ago
README.md use go mod & add drone 2 years ago
circle.yml update CI config 4 years ago
generator.go license 6 years ago
go.mod add drone 2 years ago
go.sum add drone 2 years ago
memorystore.go Session新增Keys方法,返回所有的Keys 11 months ago
session.go Session新增Keys方法,返回所有的Keys 11 months ago
session_test.go Session新增Keys方法,返回所有的Keys 11 months ago
sessions.go migrate to gitea.com/lunny/tango 3 years ago
store.go Session新增Keys方法,返回所有的Keys 11 months ago
tracker.go added HeaderTracker 6 years ago

README.md

session Build Status

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.