Documentation
¶
Index ¶
- type Session
- type SessionMgr
- func (mgr *SessionMgr) CheckCookieValid(w http.ResponseWriter, r *http.Request) (string, error)
- func (mgr *SessionMgr) EndSession(w http.ResponseWriter, r *http.Request)
- func (mgr *SessionMgr) EndSessionByID(sessionID string)
- func (mgr *SessionMgr) GetSessionValue(sessionID string, key interface{}) (interface{}, error)
- func (mgr *SessionMgr) NewSession(w http.ResponseWriter, r *http.Request) string
- func (mgr *SessionMgr) NewSessionID() string
- func (mgr *SessionMgr) SessionGC()
- func (mgr *SessionMgr) SetSessionValue(sessionID string, key interface{}, value interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SessionMgr ¶
type SessionMgr struct {
// contains filtered or unexported fields
}
SessionMgr session manager
func NewSessionMgr ¶
func NewSessionMgr(sessionName string, maxLifeTime int64) *SessionMgr
NewSessionMgr create session manager
func (*SessionMgr) CheckCookieValid ¶
func (mgr *SessionMgr) CheckCookieValid(w http.ResponseWriter, r *http.Request) (string, error)
CheckCookieValid check cookie is valid or not
func (*SessionMgr) EndSession ¶
func (mgr *SessionMgr) EndSession(w http.ResponseWriter, r *http.Request)
EndSession
func (*SessionMgr) EndSessionByID ¶
func (mgr *SessionMgr) EndSessionByID(sessionID string)
EndSessionByID end the session by session ID
func (*SessionMgr) GetSessionValue ¶
func (mgr *SessionMgr) GetSessionValue(sessionID string, key interface{}) (interface{}, error)
GetSessionValue get value fo session
func (*SessionMgr) NewSession ¶
func (mgr *SessionMgr) NewSession(w http.ResponseWriter, r *http.Request) string
NewSession create session
func (*SessionMgr) NewSessionID ¶
func (mgr *SessionMgr) NewSessionID() string
NewSessionID generate unique ID
func (*SessionMgr) SetSessionValue ¶
func (mgr *SessionMgr) SetSessionValue(sessionID string, key interface{}, value interface{}) error
SetSessionValue set value fo session
Click to show internal directories.
Click to hide internal directories.