You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
package interfaces
|
|
|
|
|
|
|
|
|
|
// ISessionAttribute Session数据接口
|
|
|
|
|
type ISessionAttribute interface {
|
|
|
|
|
// Attribute 获取指定key的值
|
|
|
|
|
Attribute(key string) interface{}
|
|
|
|
|
// Keys 获取所有Key
|
|
|
|
|
Keys() []string
|
|
|
|
|
// Exists key是否存在
|
|
|
|
|
Exists(key string) bool
|
|
|
|
|
// Attributes 获取所有数据
|
|
|
|
|
Attributes() map[string]interface{}
|
|
|
|
|
// RemoveAttribute 通过key移除数据
|
|
|
|
|
RemoveAttribute(key string)
|
|
|
|
|
// SetAttribute 设置数据
|
|
|
|
|
SetAttribute(key string, value interface{})
|
|
|
|
|
// Invalidate 使当前Session无效,并且解除所有与之绑定的对象
|
|
|
|
|
Invalidate()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ISession session接口
|
|
|
|
|
type ISession interface {
|
|
|
|
|
// ID Session ID
|
|
|
|
|
ID() int64
|
|
|
|
|
// UID 用户自行绑定UID,默认与SessionID一致
|
|
|
|
|
UID() string
|
|
|
|
|
// Bind 绑定用户ID
|
|
|
|
|
Bind(uid string)
|
|
|
|
|
// ISessionAttribute Session数据抽象方法
|
|
|
|
|
ISessionAttribute
|
|
|
|
|
}
|