Documentation ¶
Index ¶
- Constants
- func NewStore(configuration PoolConfiguration, options SessionOptions) (sessions.Store, error)
- func NewStoreCluster(configuration ClusterConfiguration, options SessionOptions) (sessions.Store, error)
- type ClusterConfiguration
- type ConnectionOptions
- type GobSerializer
- type JSONSerializer
- type PoolConfiguration
- type RadixStore
- type SerializerError
- type SessionOptions
- type SessionSerializer
Constants ¶
View Source
const ( ErrNonStringKeyValue = "non-string key value, cannot serialize session to JSON" ErrJSONSerializerSerializeError = "gorillaradix.JSONSerializer.Serialize()" ErrJSONSerializerDeSerializeError = "gorillaradix.JSONSerializer.Deserialize()" )
View Source
const (
ErrSessionDataTooBig = "gorillaradix.RadixStore.save: data to persist is over size limit"
)
Amount of time for cookies/redis keys to expire.
Variables ¶
This section is empty.
Functions ¶
func NewStore ¶
func NewStore(configuration PoolConfiguration, options SessionOptions) (sessions.Store, error)
func NewStoreCluster ¶
func NewStoreCluster(configuration ClusterConfiguration, options SessionOptions) (sessions.Store, error)
Types ¶
type ClusterConfiguration ¶
type ClusterConfiguration struct { ConnectionOptions Hosts []string }
Redis Cluster specific options
type ConnectionOptions ¶
type ConnectionOptions struct { Password string // Password for the redis server PingTimeout time.Duration // How often should we ping the redis instance Timeout time.Duration // Timeout on connecting }
Universal Redis Options
type GobSerializer ¶
type GobSerializer struct{}
GobSerializer uses gob package to encode the session map
func (GobSerializer) Deserialize ¶
func (s GobSerializer) Deserialize(d []byte, ss *sessions.Session) error
Deserialize back to map[interface{}]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 PoolConfiguration ¶
type PoolConfiguration struct { ConnectionOptions Host string }
Vanilla Redis specific options
type RadixStore ¶
type RadixStore struct { Codecs []securecookie.Codec Options SessionOptions // contains filtered or unexported fields }
func (*RadixStore) Save ¶
func (rs *RadixStore) Save(r *http.Request, w http.ResponseWriter, s *sessions.Session) error
Save should persist session to redis
type SerializerError ¶
func (*SerializerError) Error ¶
func (err *SerializerError) Error() string
type SessionOptions ¶
Click to show internal directories.
Click to hide internal directories.