Documentation ¶
Index ¶
- func ExistsDir(path string) bool
- func ExistsFile(path string) bool
- func Init(config gcore.Config) (sessionStore gcore.SessionStorage, err error)
- func NewFileStore(config interface{}) (st gcore.SessionStorage, err error)
- func NewMemoryStore(config interface{}) (st gcore.SessionStorage, err error)
- func NewRedisStore(config interface{}) (st gcore.SessionStorage, err error)
- type FileStore
- type FileStoreConfig
- type MemoryStore
- type MemoryStoreConfig
- type RedisStore
- type RedisStoreConfig
- type Session
- func (s *Session) Delete(k interface{}) (err error)
- func (s *Session) Destroy() (err error)
- func (s *Session) Get(k interface{}) (value interface{})
- func (s *Session) IsDestroy() bool
- func (s *Session) Serialize() (str string, err error)
- func (s *Session) SessionID() (sessionID string)
- func (s *Session) Set(k interface{}, v interface{})
- func (s *Session) Touch()
- func (s *Session) TouchTime() (time int64)
- func (s *Session) Unserialize(data string) (err error)
- func (s *Session) Values() (data map[interface{}]interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExistsFile ¶
func NewFileStore ¶
func NewFileStore(config interface{}) (st gcore.SessionStorage, err error)
func NewMemoryStore ¶
func NewMemoryStore(config interface{}) (st gcore.SessionStorage, err error)
func NewRedisStore ¶
func NewRedisStore(config interface{}) (st gcore.SessionStorage, err error)
Types ¶
type FileStore ¶
type FileStore struct { gcore.SessionStorage // contains filtered or unexported fields }
type FileStoreConfig ¶
type FileStoreConfig struct { Dir string GCtime int //seconds Prefix string Logger gcore.Logger TTL int64 //seconds }
func NewFileStoreConfig ¶
func NewFileStoreConfig() FileStoreConfig
type MemoryStore ¶
type MemoryStore struct { gcore.SessionStorage // contains filtered or unexported fields }
func (*MemoryStore) Delete ¶
func (s *MemoryStore) Delete(sessionID string) (err error)
type MemoryStoreConfig ¶
func NewMemoryStoreConfig ¶
func NewMemoryStoreConfig() MemoryStoreConfig
type RedisStore ¶
type RedisStore struct { gcore.SessionStorage // contains filtered or unexported fields }
func (*RedisStore) Delete ¶
func (s *RedisStore) Delete(sessionID string) (err error)
func (*RedisStore) Load ¶
func (s *RedisStore) Load(sessionID string) (sess gcore.Session, isExists bool)
func (*RedisStore) Save ¶
func (s *RedisStore) Save(sess gcore.Session) (err error)
type RedisStoreConfig ¶
type RedisStoreConfig struct { TTL int64 //seconds RedisCfg *gcache.RedisCacheConfig Logger gcore.Logger }
func NewRedisStoreConfig ¶
func NewRedisStoreConfig() RedisStoreConfig
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
func NewSession ¶
func NewSession() *Session
func (*Session) Unserialize ¶
Click to show internal directories.
Click to hide internal directories.