package interfaces // ISessionData Session数据接口 type ISessionData interface { // Remove 通过key移除数据 Remove(key string) // Set 设置数据 Set(key string, value interface{}) // Exists key是否存在 Exists(key string) bool // Value 获取指定key的值 Value(key string) interface{} // Data 获取所有数据 Data() map[string]interface{} // SetData 保存所有数据 SetData(data map[string]interface{}) // Clear 清理数据 Clear() } // ISession session接口 type ISession interface { // ID Session ID ID() int64 // UID 用户自行绑定UID,默认与SessionID一致 UID() interface{} // Bind 绑定用户ID Bind(uid interface{}) // ISessionData Session数据抽象方法 ISessionData }