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.
nnet/nface/i_session.go

32 lines
832 B
Go

package nface
2 years ago
// ISessionAttribute Session数据接口
type ISessionAttribute interface {
// Attribute 获取指定key的值
Attribute(key string) interface{}
// Keys 获取所有Key
Keys() []string
2 years ago
// 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()
2 years ago
}
// ISession session接口
type ISession interface {
// ID Session ID
ID() int64
// UID 用户自行绑定UID,默认与SessionID一致
UID() string
2 years ago
// Bind 绑定用户ID
Bind(uid string)
// ISessionAttribute Session数据抽象方法
ISessionAttribute
2 years ago
}