Documentation ¶
Index ¶
- type CookieOption
- type ICookieStore
- type IRedisStore
- type IStore
- type RedisOption
- type RedisStoreImpl
- func (s *RedisStoreImpl) Close() error
- func (s *RedisStoreImpl) Get(r *http.Request, name string) (*sessions.Session, error)
- func (s *RedisStoreImpl) New(request *http.Request, name string) (*sessions.Session, error)
- func (s *RedisStoreImpl) Save(r *http.Request, w http.ResponseWriter, session *sessions.Session) error
- func (s *RedisStoreImpl) SetMaxAge(maxAge int)
- func (s *RedisStoreImpl) SetMaxLength(maxLength int)
- func (s *RedisStoreImpl) SetPrefix(prefix string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CookieOption ¶
type CookieOption struct { Name string `json:"name"` Path string `json:"path"` Domain string `json:"domain"` MaxAge int `json:"max_age"` IsHttpOnly bool `json:"is_http_only"` IsSecure bool `json:"is_secure"` }
================================================================================ * cookie store interface * qq group: 582452342 * email : 2091938785@qq.com * author : 美丽的地球啊 - mliu * ================================================================================
type ICookieStore ¶
type ICookieStore interface { IStore Options(CookieOption) }
================================================================================ * cookie store interface * qq group: 582452342 * email : 2091938785@qq.com * author : 美丽的地球啊 - mliu * ================================================================================
func NewCookieStore ¶
func NewCookieStore(keyPairs ...[]byte) ICookieStore
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * Session会话Cookie存储 * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
type IRedisStore ¶
type IRedisStore interface { IStore Options(CookieOption) }
================================================================================ * redis store interface * qq group: 582452342 * email : 2091938785@qq.com * author : 美丽的地球啊 - mliu * ================================================================================
func NewRedisStore ¶
func NewRedisStore(ip string, port int, password, prefixKey string, encryptKey []byte, dbIndex int) IRedisStore
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * Session会话Cookie存储 * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
type IStore ¶
================================================================================ * cookie store interface * qq group: 582452342 * email : 2091938785@qq.com * author : 美丽的地球啊 - mliu * ================================================================================
type RedisOption ¶
================================================================================ * redis store interface * qq group: 582452342 * email : 2091938785@qq.com * author : 美丽的地球啊 - mliu * ================================================================================
type RedisStoreImpl ¶
type RedisStoreImpl struct { Pool *redis.Pool Options *sessions.Options DefaultMaxAge int // contains filtered or unexported fields }
================================================================================ * redis store impl * qq group: 582452342 * email : 2091938785@qq.com * author : 美丽的地球啊 - mliu * ================================================================================
func NewRedisStoreImpl ¶
func NewRedisStoreImpl(network, address, password string, encryptKey []byte, size, dbIndex int) (*RedisStoreImpl, error)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * 实例化RedisStoreImpl * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
func NewRedisStoreImplWithPool ¶
func NewRedisStoreImplWithPool(pool *redis.Pool, encryptKey []byte) (*RedisStoreImpl, error)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * 实例化RedisPool * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
func (*RedisStoreImpl) Close ¶
func (s *RedisStoreImpl) Close() error
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * 关闭redis链接 * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
func (*RedisStoreImpl) Get ¶
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * 获取会话 * IStore接口实现 * 第一次会回调当前store的New,实例化Store * 随后会从Register缓存sessions map[string]sessionInfo的里取出sessionInfo对象里的s值即sessions.Session对象 * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
func (*RedisStoreImpl) New ¶
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * 实例化会话 * IStore接口实现 * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
func (*RedisStoreImpl) Save ¶
func (s *RedisStoreImpl) Save(r *http.Request, w http.ResponseWriter, session *sessions.Session) error
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * 保存会话 * IStore接口实现 * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
func (*RedisStoreImpl) SetMaxAge ¶
func (s *RedisStoreImpl) SetMaxAge(maxAge int)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * 设置会话最大有效时间(单位:秒) * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
func (*RedisStoreImpl) SetMaxLength ¶
func (s *RedisStoreImpl) SetMaxLength(maxLength int)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * 设置最大长度 * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
func (*RedisStoreImpl) SetPrefix ¶
func (s *RedisStoreImpl) SetPrefix(prefix string)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * 设置Redis Key 前缀 * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++