Documentation
¶
Index ¶
- type GobSerializer
- type JSONSerializer
- type KeyGenFunc
- type RedisStore
- func (s *RedisStore) Close() error
- func (s *RedisStore) Delete(r *http.Request, w http.ResponseWriter, session *sessions.Session) error
- func (s *RedisStore) Get(r *http.Request, name string) (*sessions.Session, error)
- func (s *RedisStore) KeyGen(f KeyGenFunc)
- func (s *RedisStore) KeyPrefix(keyPrefix string)
- func (s *RedisStore) MaxAge(v int)
- func (s *RedisStore) New(r *http.Request, name string) (*sessions.Session, error)
- func (s *RedisStore) Options(opts sessions.Options)
- func (s *RedisStore) Save(r *http.Request, w http.ResponseWriter, session *sessions.Session) error
- func (s *RedisStore) Serializer(ss SessionSerializer)
- func (s *RedisStore) SetMaxLength(l int)
- type SessionSerializer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GobSerializer ¶
type GobSerializer struct{}
GobSerializer is Gob Serializer
func (GobSerializer) Deserialize ¶
func (gs GobSerializer) Deserialize(d []byte, s *sessions.Session) error
Deserialize back to map[string]interface{}
type JSONSerializer ¶
type JSONSerializer struct{}
JSONSerializer encode the session map to JSON.
func (JSONSerializer) Deserialize ¶
func (s JSONSerializer) Deserialize(d []byte, ss *sessions.Session) error
Deserialize back to map[string]interface{}
type KeyGenFunc ¶
type KeyGenFunc func() string
KeyGenFunc defines a function used by store to generate a key
type RedisStore ¶
type RedisStore struct {
Codecs []securecookie.Codec
DefaultMaxAge int // default Redis TTL for a MaxAge == 0 session
// contains filtered or unexported fields
}
RedisStore stores gorilla sessions in Redis
func NewRedisStore ¶
func NewRedisStore(client redis.UniversalClient, keyPairs ...[]byte) (*RedisStore, error)
NewRedisStore returns a new RedisStore with default configuration
func NewRedisStoreSimple ¶
func NewRedisStoreSimple(address, password string, db int, keyPairs ...[]byte) (*RedisStore, error)
NewRedisStoreSimple returns a new RedisStore with easy config
func NewRedisStoreWithRedisConfig ¶
func NewRedisStoreWithRedisConfig(options *redis.Options, keyPairs ...[]byte) (*RedisStore, error)
NewRedisStoreWithRedisConfig returns a new RedisStore with default Redis configuration
func (*RedisStore) Close ¶
func (s *RedisStore) Close() error
Close closes the underlying *redis client
func (*RedisStore) Delete ¶ added in v1.1.0
func (s *RedisStore) Delete(r *http.Request, w http.ResponseWriter, session *sessions.Session) error
func (*RedisStore) KeyGen ¶
func (s *RedisStore) KeyGen(f KeyGenFunc)
KeyGen sets the key generator function
func (*RedisStore) KeyPrefix ¶
func (s *RedisStore) KeyPrefix(keyPrefix