Documentation ¶
Index ¶
- func Md5(text string) string
- func Open()
- type IO
- type Manager
- type Reader
- type Session
- func (session *Session) Belong(req *http.Request) bool
- func (session *Session) Delete(key string)
- func (session *Session) ExpireTime(expireTime time.Duration) time.Duration
- func (session *Session) Expired() bool
- func (session *Session) ExtraInfo(address, userAgent string) (string, string)
- func (session *Session) Get(key string) (res string, ok bool)
- func (session *Session) GetInt(key string) (res int, ok bool)
- func (session *Session) GetTime(key string) (res time.Time, ok bool)
- func (session *Session) Have(key string) bool
- func (session *Session) ID() string
- func (session *Session) Lock()
- func (session *Session) Put(key string, value string, expireTime time.Duration)
- func (session *Session) PutInt(key string, value int, expireTime time.Duration)
- func (session *Session) PutTime(key string, value time.Time, expireTime time.Duration)
- func (session *Session) RLock()
- func (session *Session) RUnlock()
- func (session *Session) Unlock()
- type Writer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type IO ¶
IO Interface
type Manager ¶
type Manager interface { ExpireTime(expireTime time.Duration) time.Duration Belong(*http.Request) bool ExtraInfo(address, userAgent string) (string, string) RLock() RUnlock() Lock() Unlock() Expired() bool ID() string // contains filtered or unexported methods }
Manager Interface
type Reader ¶
type Reader interface { Get(key string) (string, bool) GetInt(key string) (int, bool) GetTime(key string) (time.Time, bool) Have(key string) bool }
Reader Interface
type Session ¶
type Session struct { Map map[string]*sessionObj // contains filtered or unexported fields }
Session struct
func (*Session) ExpireTime ¶
ExpireTime set the ExpireTime of session and retuen ExpireTime of session, ExpireTime smaller than 0 will not change ExpireTime of session so than can be use to get ExpireTime
func (*Session) ExtraInfo ¶
ExtraInfo set ExtraInfo for auth, set "" will not change, can use to get ExtraInfo
func (*Session) Get ¶
Get return type is string if not have key or value type is not string return ""
Click to show internal directories.
Click to hide internal directories.