mirror of
https://github.com/astaxie/beego.git
synced 2025-06-29 21:20:19 +00:00
update some tips
This commit is contained in:
@ -81,17 +81,21 @@ Writing a provider is easy. You only need to define two struct types
|
||||
Maybe you will find the **memory** provider as good example.
|
||||
|
||||
type SessionStore interface {
|
||||
Set(key, value interface{}) error // set session value
|
||||
Get(key interface{}) interface{} // get session value
|
||||
Delete(key interface{}) error // delete session value
|
||||
SessionID() string // return current sessionID
|
||||
SessionRelease() // release the resource
|
||||
Set(key, value interface{}) error //set session value
|
||||
Get(key interface{}) interface{} //get session value
|
||||
Delete(key interface{}) error //delete session value
|
||||
SessionID() string //back current sessionID
|
||||
SessionRelease() // release the resource & save data to provider
|
||||
Flush() error //delete all data
|
||||
}
|
||||
|
||||
type Provider interface {
|
||||
SessionInit(maxlifetime int64, savePath string) error
|
||||
SessionRead(sid string) (SessionStore, error)
|
||||
SessionExist(sid string) bool
|
||||
SessionRegenerate(oldsid, sid string) (SessionStore, error)
|
||||
SessionDestroy(sid string) error
|
||||
SessionAll() int //get all active session
|
||||
SessionGC()
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user