Documentation ¶
Index ¶
- Constants
- Variables
- type FileSession
- func (this *FileSession) CloseSession(ctx *context.Context)
- func (this *FileSession) GC()
- func (this *FileSession) Get(ctx *context.Context, key string) interface{}
- func (this *FileSession) GetSession(ctx *context.Context) (Session, error)
- func (this *FileSession) GetSessionFilePath(id string) string
- func (this *FileSession) OpenSession(ctx *context.Context)
- func (this *FileSession) Set(ctx *context.Context, key string, value interface{})
- func (this *FileSession) SetSession(ctx *context.Context, session Session)
- func (this *FileSession) UpdateSession(ctx *context.Context)
- type RedisSession
- type Session
- type SessionManager
- func (this *SessionManager) CloseSession(ctx *context.Context)
- func (this *SessionManager) GC()
- func (this *SessionManager) Get(ctx *context.Context, key string) interface{}
- func (this *SessionManager) GetSession(ctx *context.Context) (Session, error)
- func (this *SessionManager) LoadCookieValue(ctx *context.Context) string
- func (this *SessionManager) NewSessionID() (string, error)
- func (this *SessionManager) OpenSession(ctx *context.Context)
- func (this *SessionManager) Set(ctx *context.Context, key string, value interface{})
- func (this *SessionManager) SetSession(ctx *context.Context, session Session)
- func (this *SessionManager) UpdateSession(ctx *context.Context)
- type SessionMgrInterface
Constants ¶
View Source
const ( FILE_SESSION = "file" REDIS_SESSION = "redis" )
Variables ¶
View Source
var (
SESS_ID string
)
Functions ¶
This section is empty.
Types ¶
type FileSession ¶
type FileSession struct { SessPath string SessionManager }
func (*FileSession) CloseSession ¶
func (this *FileSession) CloseSession(ctx *context.Context)
func (*FileSession) GC ¶
func (this *FileSession) GC()
func (*FileSession) Get ¶
func (this *FileSession) Get(ctx *context.Context, key string) interface{}
func (*FileSession) GetSession ¶
func (this *FileSession) GetSession(ctx *context.Context) (Session, error)
func (*FileSession) GetSessionFilePath ¶
func (this *FileSession) GetSessionFilePath(id string) string
func (*FileSession) OpenSession ¶
func (this *FileSession) OpenSession(ctx *context.Context)
func (*FileSession) Set ¶
func (this *FileSession) Set(ctx *context.Context, key string, value interface{})
func (*FileSession) SetSession ¶
func (this *FileSession) SetSession(ctx *context.Context, session Session)
func (*FileSession) UpdateSession ¶
func (this *FileSession) UpdateSession(ctx *context.Context)
type RedisSession ¶
type RedisSession struct {
SessionManager
}
type Session ¶
type Session struct { SessID string `json:"sessid"` LastTimeAccessed int64 `json:"lsttm"` Values map[string]interface{} `json:"values"` }
func NewSessionObject ¶
func NewSessionObject() *Session
type SessionManager ¶
type SessionManager struct {
// contains filtered or unexported fields
}
func (*SessionManager) CloseSession ¶
func (this *SessionManager) CloseSession(ctx *context.Context)
func (*SessionManager) GC ¶
func (this *SessionManager) GC()
func (*SessionManager) Get ¶
func (this *SessionManager) Get(ctx *context.Context, key string) interface{}
func (*SessionManager) GetSession ¶
func (this *SessionManager) GetSession(ctx *context.Context) (Session, error)
func (*SessionManager) LoadCookieValue ¶
func (this *SessionManager) LoadCookieValue(ctx *context.Context) string
func (*SessionManager) NewSessionID ¶
func (this *SessionManager) NewSessionID() (string, error)
func (*SessionManager) OpenSession ¶
func (this *SessionManager) OpenSession(ctx *context.Context)
func (*SessionManager) Set ¶
func (this *SessionManager) Set(ctx *context.Context, key string, value interface{})
func (*SessionManager) SetSession ¶
func (this *SessionManager) SetSession(ctx *context.Context, session Session)
func (*SessionManager) UpdateSession ¶
func (this *SessionManager) UpdateSession(ctx *context.Context)
type SessionMgrInterface ¶
type SessionMgrInterface interface { OpenSession(ctx *context.Context) CloseSession(ctx *context.Context) SetSession(ctx *context.Context, session Session) Set(ctx *context.Context, key string, value interface{}) GetSession(ctx *context.Context) (Session, error) Get(ctx *context.Context, key string) interface{} UpdateSession(ctx *context.Context) GC() }
func NewSessionManager ¶
func NewSessionManager(sess_type string, iMaxlife int64, ext_params map[string]interface{}) SessionMgrInterface
Click to show internal directories.
Click to hide internal directories.