Documentation
¶
Index ¶
- func GetSidFromCookies(cook []*http.Cookie, authName string) string
- func GetSidFromHeader(h *http.Request) (string, string)
- func GetSidFromQuery(values url.Values, authName string) string
- type FileSession
- func (fse *FileSession) AutoDestroy()
- func (fse *FileSession) Close() bool
- func (fse *FileSession) Destroy(sid string) bool
- func (fse *FileSession) Gc(maxLeftTime int64) bool
- func (fse *FileSession) GetFileName(sid string) string
- func (fse *FileSession) Open(savePath string) bool
- func (fse *FileSession) Read(sid string) map[string]interface{}
- func (fse *FileSession) SetPrefix(keyPrefix string)
- func (fse *FileSession) Write(sid string, data map[string]interface{}) bool
- type ISession
- type IUserSession
- type RedisSession
- func (rs *RedisSession) Close() bool
- func (rs *RedisSession) Destroy(sid string) bool
- func (rs *RedisSession) Gc(maxLeftTime int64) bool
- func (rs *RedisSession) Open(savePath string) bool
- func (rs *RedisSession) Read(sid string) map[string]interface{}
- func (rs *RedisSession) SetPrefix(keyPrefix string)
- func (rs *RedisSession) Write(sid string, mp map[string]interface{}) bool
- type SError
- type UserSession
- func (s *UserSession) GetAuthName() string
- func (s *UserSession) GetData() (data *utils.MapReader, err error)
- func (s *UserSession) GetProperty(name string) interface{}
- func (s *UserSession) GetUserId() int64
- func (s *UserSession) SetData(data *utils.MapReader) error
- func (s *UserSession) SetSessionHandler(session ISession) error
- func (s *UserSession) SetUserIdKey(idName string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type FileSession ¶
type FileSession struct {
SError
// contains filtered or unexported fields
}
func GetNewFileSession ¶
func GetNewFileSession(path string, maxLeftTime int64) *FileSession
func (*FileSession) AutoDestroy ¶
func (fse *FileSession) AutoDestroy()
func (*FileSession) Close ¶
func (fse *FileSession) Close() bool
func (*FileSession) Destroy ¶
func (fse *FileSession) Destroy(sid string) bool
func (*FileSession) Gc ¶
func (fse *FileSession) Gc(maxLeftTime int64) bool
func (*FileSession) GetFileName ¶
func (fse *FileSession) GetFileName(sid string) string
func (*FileSession) Open ¶
func (fse *FileSession) Open(savePath string) bool
func (*FileSession) Read ¶
func (fse *FileSession) Read(sid string) map[string]interface{}
func (*FileSession) SetPrefix ¶ added in v1.1.5
func (fse *FileSession) SetPrefix(keyPrefix string)
type IUserSession ¶
type IUserSession interface {
SetData(data *utils.MapReader) error
GetData() (data *utils.MapReader, err error)
GetUserId() int64
GetProperty(name string) interface{}
GetAuthName() string
SetSessionHandler(session ISession) error
SetUserIdKey(idName string)
}
func GetNewUserSession ¶
func GetNewUserSession(sid string, session ISession) IUserSession
type RedisSession ¶
type RedisSession struct {
SError
// contains filtered or unexported fields
}
func GetNewRedisSession ¶
func GetNewRedisSession(client *redis.Client, maxLeftTime int64) *RedisSession
func (*RedisSession) Close ¶
func (rs *RedisSession) Close() bool
func (*RedisSession) Destroy ¶
func (rs *RedisSession) Destroy(sid string) bool
func (*RedisSession) Gc ¶
func (rs *RedisSession) Gc(maxLeftTime int64) bool
func (*RedisSession) Open ¶
func (rs *RedisSession) Open(savePath string) bool
func (*RedisSession) Read ¶
func (rs *RedisSession) Read(sid string) map[string]interface{}
func (*RedisSession) SetPrefix ¶ added in v1.1.5
func (rs *RedisSession) SetPrefix(keyPrefix string)
type UserSession ¶
type UserSession struct {
UserId int64 `json:"userId"`
Property *utils.MapReader `json:"property"`
Sid string `json:"sid"`
// contains filtered or unexported fields
}
func (*UserSession) GetAuthName ¶
func (s *UserSession) GetAuthName() string
func (*UserSession) GetProperty ¶
func (s *UserSession) GetProperty(name string) interface{}
func (*UserSession) GetUserId ¶
func (s *UserSession) GetUserId() int64
func (*UserSession) SetSessionHandler ¶
func (s *UserSession) SetSessionHandler(session ISession) error
func (*UserSession) SetUserIdKey ¶ added in v1.1.5
func (s *UserSession) SetUserIdKey(idName string)
Click to show internal directories.
Click to hide internal directories.