Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateID ¶
func GenerateID() string
func RegisterCodec ¶
Types ¶
type Codec ¶
type Codec interface { Encode(values map[interface{}]interface{}) ([]byte, error) Decode(buf []byte) (map[interface{}]interface{}, error) }
codec for session encode and decode
type RedisDriver ¶
type RedisDriver struct { }
func (RedisDriver) Open ¶
func (d RedisDriver) Open(jsonConfig json.RawMessage) (Store, error)
json config: json encode RedisStoreConfig
type RedisStore ¶
type RedisStore struct {
// contains filtered or unexported fields
}
func (*RedisStore) Delete ¶
func (store *RedisStore) Delete(s *Session) error
func (*RedisStore) Save ¶
func (store *RedisStore) Save(s *Session) error
type RedisStoreConfig ¶
type RedisStoreConfig struct { Password string `json:"password"` Addr string `json:"addr"` DB int `json:"db"` //sesion max age, like http cookie max-age MaxAge int `json:"maxage"` //name registered for codec //if no name supplied, use default GobCodec for session encode/decode CodecName string `json:"codec"` //max idle connection for remote redis MaxIdle int `json:"maxidle"` }
type Session ¶
type Session struct { Values map[interface{}]interface{} MaxAge int // contains filtered or unexported fields }
Click to show internal directories.
Click to hide internal directories.