SessionStorage 会话存储
| 6 | |
| 7 | // SessionStorage 会话存储 |
| 8 | type SessionStorage interface { |
| 9 | // Len 返回存储中的键值对数量 |
| 10 | // Returns the number of key-value pairs in the storage |
| 11 | Len() int |
| 12 | |
| 13 | // Load 根据键获取值,如果键存在则返回值和 true,否则返回 nil 和 false |
| 14 | // retrieves the value for a given key. If the key exists, it returns the value and true; otherwise, it returns nil and false |
| 15 | Load(key string) (value any, exist bool) |
| 16 | |
| 17 | // Delete 根据键删除存储中的键值对 |
| 18 | // removes the key-value pair from the storage for a given key |
| 19 | Delete(key string) |
| 20 | |
| 21 | // Store 存储键值对 |
| 22 | // saves the key-value pair in the storage |
| 23 | Store(key string, value any) |
| 24 | |
| 25 | // Range 遍历 |
| 26 | // 如果函数返回 false,遍历将提前终止. |
| 27 | // If the function returns false, the iteration stops early. |
| 28 | Range(f func(key string, value any) bool) |
| 29 | } |
| 30 | |
| 31 | // newSmap 创建并返回一个新的 smap 实例 |
| 32 | // creates and returns a new smap instance |
no outgoing calls
no test coverage detected