Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RedisStore ¶
type RedisStore struct {
// contains filtered or unexported fields
}
RedisStore represents the session store.
func New ¶
func New(pool *redis.Pool) *RedisStore
New returns a new RedisStore instance. The pool parameter should be a pointer to a redigo connection pool. See https://godoc.org/github.com/gomodule/redigo/redis#Pool.
func NewWithPrefix ¶
func NewWithPrefix(pool *redis.Pool, prefix string) *RedisStore
NewWithPrefix returns a new RedisStore instance. The pool parameter should be a pointer to a redigo connection pool. The prefix parameter controls the Redis key prefix, which can be used to avoid naming clashes if necessary.
func (*RedisStore) All ¶
func (r *RedisStore) All() (map[string][]byte, error)
All returns a map containing the token and data for all active (i.e. not expired) sessions in the RedisStore instance.
func (*RedisStore) Commit ¶
Commit adds a session token and data to the RedisStore instance with the given expiry time. If the session token already exists then the data and expiry time are updated.
func (*RedisStore) Delete ¶
func (r *RedisStore) Delete(token string) error
Delete removes a session token and corresponding data from the RedisStore instance.