Documentation
¶
Index ¶
Constants ¶
View Source
const DefaultCookieKey = "go_admin_session"
Variables ¶
This section is empty.
Functions ¶
func GetSessionByKey ¶
func GetSessionByKey(sesKey, key string, conn db.Connection) interface{}
GetSessionByKey get the session value by key.
Types ¶
type DBDriver ¶
type DBDriver struct {
// contains filtered or unexported fields
}
DBDriver is a driver which uses database as a persistence tool.
type PersistenceDriver ¶
type PersistenceDriver interface { Load(string) map[string]interface{} Update(sid string, values map[string]interface{}) }
PersistenceDriver is a driver of storing and getting the session info.
type Session ¶
type Session struct { Expires time.Duration Cookie string Values map[string]interface{} Driver PersistenceDriver Sid string Context *context.Context }
Session contains info of session.
func InitSession ¶
func InitSession(ctx *context.Context, conn db.Connection) *Session
InitSession return the default Session.
func (*Session) UpdateConfig ¶
UpdateConfig update the Expires and Cookie of Session.
func (*Session) UseDriver ¶
func (ses *Session) UseDriver(driver PersistenceDriver)
UseDriver set the driver of the Session.
Click to show internal directories.
Click to hide internal directories.