Documentation ¶
Index ¶
- type MemoryStore
- func (ms *MemoryStore) Close()
- func (ms *MemoryStore) Delete(key string)
- func (ms *MemoryStore) Get(key string, clear bool) (any, int64, bool)
- func (ms *MemoryStore) IsExpired(key string) bool
- func (ms *MemoryStore) Set(key string, value any, ttl time.Duration)
- func (ms *MemoryStore) Stats() map[string]any
- type TimeWheel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MemoryStore ¶
type MemoryStore struct {
// contains filtered or unexported fields
}
MemoryStore 是主存储结构,包含多个分片
func NewMemoryStore ¶
func NewMemoryStore(shardCount int, slotCount int, tickInterval time.Duration) *MemoryStore
NewMemoryStore 创建一个新的 MemoryStore
func (*MemoryStore) IsExpired ¶
func (ms *MemoryStore) IsExpired(key string) bool
IsExpired 检查指定键是否已过期
Click to show internal directories.
Click to hide internal directories.