Documentation ¶
Index ¶
- Variables
- func ID() string
- func Lang(process *process.Process, defaults ...string) string
- func Register(name string, manger Manager)
- type BuntDB
- type Manager
- type Redis
- type Session
- func (session *Session) AsGlobal() *Session
- func (session *Session) Dump() (map[string]interface{}, error)
- func (session *Session) Expire(expiredAt time.Duration) *Session
- func (session *Session) Get(key string) (interface{}, error)
- func (session *Session) GetID() string
- func (session *Session) ID(id string) *Session
- func (session *Session) Make() *Session
- func (session *Session) MustDump() map[string]interface{}
- func (session *Session) MustGet(key string) interface{}
- func (session *Session) MustSet(key string, value interface{})
- func (session *Session) MustSetMany(values map[string]interface{})
- func (session *Session) MustSetManyWithEx(values map[string]interface{}, timeout time.Duration)
- func (session *Session) MustSetWithEx(key string, value interface{}, timeout time.Duration)
- func (session *Session) Set(key string, value interface{}) error
- func (session *Session) SetMany(values map[string]interface{}) error
- func (session *Session) SetManyWithEx(values map[string]interface{}, timeout time.Duration) error
- func (session *Session) SetWithEx(key string, value interface{}, timeout time.Duration) error
Constants ¶
This section is empty.
Variables ¶
View Source
var Managers = map[string]Manager{}
Managers 已注册会话管理器
View Source
var Name string = "buntdb"
Name 默认为会话管理器
View Source
var SessionHandlers = map[string]process.Handler{
"id": processID,
"get": processGet,
"set": processSet,
"dump": processDump,
"setmany": processSetMany,
}
SessionHandlers 模型运行器
View Source
var Timeout time.Duration = 3600 * time.Second
Timeout 默认有效时间
Functions ¶
Types ¶
type BuntDB ¶
type BuntDB struct {
// contains filtered or unexported fields
}
BuntDB BuntDB store
type Manager ¶
type Manager interface { Init() Set(id string, key string, value interface{}, expired time.Duration) error Get(id string, key string) (interface{}, error) Dump(id string) (map[string]interface{}, error) }
Manager Session 管理器
type Redis ¶
type Redis struct {
// contains filtered or unexported fields
}
Redis session store
func NewRedis ¶
NewRedis create a new redis instance host string, port int, db int, password string, username string, timeout int
type Session ¶
type Session struct { Manager Manager // contains filtered or unexported fields }
Session 数据结构
func (*Session) MustSetMany ¶
MustSetMany 设置多个数值
func (*Session) MustSetManyWithEx ¶
MustSetManyWithEx 设置多个数值
func (*Session) MustSetWithEx ¶
MustSetWithEx 设置数值
func (*Session) SetManyWithEx ¶
SetManyWithEx 设置多个数值
Click to show internal directories.
Click to hide internal directories.