Documentation ¶
Index ¶
- Variables
- func NewNegroniSentinelGobStore(Sentinel *redis.Client, sessionExpire int, keyPairs ...[]byte) nSessions.Store
- func NewNegroniSentinelJsonStore(Sentinel *redis.Client, sessionExpire int, keyPairs ...[]byte) nSessions.Store
- func RedisInit(rc *RedisConf) (*redis.Client, error)
- type GobSerializer
- type JSONSerializer
- type NegroniSentinleStore
- type RedisConf
- type SentinleStore
- func (s *SentinleStore) Close() error
- func (s *SentinleStore) Delete(r *http.Request, w http.ResponseWriter, session *sessions.Session) error
- func (s *SentinleStore) Get(r *http.Request, name string) (*sessions.Session, error)
- func (s *SentinleStore) New(r *http.Request, name string) (*sessions.Session, error)
- func (s *SentinleStore) Save(r *http.Request, w http.ResponseWriter, session *sessions.Session) error
- func (s *SentinleStore) SetKeyPrefix(p string)
- func (s *SentinleStore) SetMaxAge(v int)
- func (s *SentinleStore) SetMaxLength(l int)
- func (s *SentinleStore) SetSerializer(ss SessionSerializer)
- type SessionSerializer
Constants ¶
This section is empty.
Variables ¶
View Source
var Logger *log.Logger
View Source
var MySentinel *redis.Client
Functions ¶
func NewNegroniSentinelGobStore ¶
func NewNegroniSentinelGobStore(Sentinel *redis.Client, sessionExpire int, keyPairs ...[]byte) nSessions.Store
New returns a new Sentinel store
Types ¶
type GobSerializer ¶
type GobSerializer struct{}
Gob 序列化类型
func (GobSerializer) Deserialize ¶
func (s GobSerializer) Deserialize(d []byte, ss *sessions.Session) error
Gob 反序列化
type JSONSerializer ¶
type JSONSerializer struct{}
json 序列化类型
func (JSONSerializer) Deserialize ¶
func (s JSONSerializer) Deserialize(d []byte, ss *sessions.Session) error
json 反序列化
type NegroniSentinleStore ¶
type NegroniSentinleStore struct {
*SentinleStore
}
func (*NegroniSentinleStore) Options ¶
func (c *NegroniSentinleStore) Options(options nSessions.Options)
type RedisConf ¶
type RedisConf struct { Password string DB int TimeOut int Pool int MasterName string Sentinels []string }
var MyRedisConf *RedisConf
type SentinleStore ¶
type SentinleStore struct { Sentinel *redis.Client Codecs []securecookie.Codec Options *sessions.Options DefaultMaxAge int // contains filtered or unexported fields }
SentinleStore类型
func NewSentinelGobStore ¶
func NewSentinelGobStore(Sentinel *redis.Client, sessionExpire int, keyPairs ...[]byte) *SentinleStore
创建sentine store
func NewSentinelJsonStore ¶
func NewSentinelJsonStore(Sentinel *redis.Client, sessionExpire int, keyPairs ...[]byte) *SentinleStore
func (*SentinleStore) Delete ¶
func (s *SentinleStore) Delete(r *http.Request, w http.ResponseWriter, session *sessions.Session) error
删除session信息
func (*SentinleStore) Save ¶
func (s *SentinleStore) Save(r *http.Request, w http.ResponseWriter, session *sessions.Session) error
保存session信息
func (*SentinleStore) SetSerializer ¶
func (s *SentinleStore) SetSerializer(ss SessionSerializer)
设置序列化工具
Click to show internal directories.
Click to hide internal directories.