Documentation ¶
Index ¶
- Variables
- func NewId() string
- func Register(name string, driver Driver)
- type Driver
- type MCache
- func (mc *MCache) Abandon(sessionId string) error
- func (mc *MCache) Add(sessionId, key string, value interface{}) (bool, error)
- func (mc *MCache) Exists(sessionId string) (bool, error)
- func (mc *MCache) Get(sessionId, key string) (interface{}, bool, error)
- func (mc *MCache) Init(options string) error
- func (mc *MCache) Keys(sessionId string) ([]string, error)
- func (mc *MCache) Name() string
- func (mc *MCache) New(sessionId string, timeout time.Duration) error
- func (mc *MCache) Remove(sessionId, key string) error
- func (mc *MCache) Set(sessionId, key string, value interface{}) error
- type Session
Constants ¶
This section is empty.
Variables ¶
View Source
var (
SessionNotExists = errors.New("session id doesn't exists")
)
Functions ¶
Types ¶
type Driver ¶
type Driver interface { // Initialize setup this driver Init(options string) error // return name of this driver Name() string // Get return item value of session marked with sessionId, return false if key exists Add(sessionId, key string, value interface{}) (bool, error) // Get return item value of session marked with sessionId, return false if key doesn't exists Get(sessionId, key string) (interface{}, bool, error) // Set add or update a item Set(sessionId, key string, value interface{}) error // Remove remove item from session Remove(sessionId, key string) error // New create a new session entry New(sessionId string, timeout time.Duration) error // Abandon mark session abandon Abandon(sessionId string) error // Exists return false if sessionId doesn't exists Exists(sessionId string) (bool, error) // Keys all item keys of session Keys(sessionId string) ([]string, error) }
Click to show internal directories.
Click to hide internal directories.