Documentation ¶
Index ¶
- func GenerateRandomKey(r *http.Request) (string, error)
- type KeyGenFunc
- type Option
- type Options
- type RedisStore
- func (st *RedisStore) Get(r *http.Request, name string) (*sessions.Session, error)
- func (st *RedisStore) New(r *http.Request, name string) (*sessions.Session, error)
- func (st *RedisStore) Save(r *http.Request, w http.ResponseWriter, session *sessions.Session) error
- func (st *RedisStore) SetOptions(opts *sessions.Options)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Option ¶
type Option func(ops *Options)
func WithKeyGenFunc ¶
func WithKeyGenFunc(fn KeyGenFunc) Option
func WithKeyPairs ¶
func WithKeyPrefix ¶
func WithMaxLength ¶
func WithOptions ¶
func WithSerializer ¶
func WithSerializer(serializer serializer.SessionSerializer) Option
type Options ¶
type Options struct { Codecs []securecookie.Codec Options *sessions.Options MaxLength int KeyPrefix string KeyGenFunc KeyGenFunc Serializer serializer.SessionSerializer }
type RedisStore ¶
type RedisStore struct {
// contains filtered or unexported fields
}
func NewStoreWithUniversalClient ¶
func NewStoreWithUniversalClient(client redis.UniversalClient, optFns ...Option) (*RedisStore, error)
func (*RedisStore) New ¶
New should create and return a new session.
Note that New should never return a nil session, even in the case of an error if using the Registry infrastructure to cache the session.
func (*RedisStore) Save ¶
func (st *RedisStore) Save(r *http.Request, w http.ResponseWriter, session *sessions.Session) error
Save should persist session to the underlying store implementation.
func (*RedisStore) SetOptions ¶
func (st *RedisStore) SetOptions(opts *sessions.Options)
Click to show internal directories.
Click to hide internal directories.