Documentation ¶
Overview ¶
Description: a session middleware based on mongodb, gorilla-session and gin-gonic Author: ZHU HAIHUA Since: 2016-04-07 20:20
Description: a session middleware based on mysql, gorilla-session and gin-gonic Author: ZHU HAIHUA Since: 2016-04-07 22:34
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MongoStore ¶
type MongoStore interface { ginsession.Store }
func NewMongoStore ¶
func NewMongoStore(s *mgo.Session, dbName, collectionName string, maxAge int, ensureTTL bool, keyPairs ...[]byte) MongoStore
NewMongoStore return a session store based on mongodb
type MySQLStore ¶
type MySQLStore interface { ginsession.Store }
func NewMySQLStore ¶
func NewMySQLStore(endpoint, tableName string, keyPairs ...[]byte) (MySQLStore, error)
NewMySQLStore return a session store based on mysql
by default the maxAge is 0, you can change the value by setting session.Options: session.Options(Options{ MaxAge: 3600, Domain: localhost, Path: "/foo/bar/bat", })
Click to show internal directories.
Click to hide internal directories.